[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

DOS problem solved--XyBasic available



I've solved my legacy BASIC compiler problem in a weird way. I can do the
whole thing on the Mac, using Virtual PC, then copy the results over to the
Win laptop. I have a virtual Win 98 with FAT16 working on the Mac. It's
pretty fast, too (and, as I've reported long ago, it runs Xy).
Now I can repeat my offer of my XyBasic translator to anyone who wants it.
(XyBasic runs on any OS and any file system--it's just that I couldn't
support it until I found the Mac-based solution.) This translator, which no
one seems to want, allows you to write code in BASIC, then run XyBasic.exe
to produce an XPL translation. The translation is virtually instantaneous.
What follows, between the horizontal lines, is a sample program written in
XyBasic. It's not a good program, and it's not well tested--but it
illustrates a few of the features of the language, which implements most of
the BASIC language features:
------------------------------------------
; A very simple program, for my wife, to beep at her every two minutes
; She requested this--don't ask why. (Comments are introduced by semicolons)
; note that you can have extra blank lines, leading spaces, and tabs--flexible formatting.
defint elapsed_time = 02 ; here I assign a s/g #--by default, XyBasic
assigns them.

main_loop:        ; a label
'bc ; Xy functions are entered with a leading apostrophe: easy to type in.
prompt "Hit Any Key (but x) to start 2-minute timer"
resp$ = inkey$      ;  get a keystroke from user, store it in "resp$"
if resp$ = "x" then prompt "Exited program." : stop
; "comx," below, is for commands--BX / Q2 for what's in quotes--"com" does BC / XC
comx "beep"       ; needed to initialize Jean's beep
for elapsed_time= 0 to 120 ; FOR/NEXT loops are supported, as are GOTO and GOSUB
  comx "p 1"              ; pause for one second each loop
prompt "@02" ; display the elapsed seconds on the Prompt line
next elapsed_time

comx "beep"
goto main_loop

---------------------------------
 XyBasic.exe translates that to this XPL:

XPLeNCODE v2.0
b-gin [UNTITLED]
{<}SV02,0{>};*;[cr|lf]{<}LBA{>};*; MAIN_LOOP [cr|lf][BC_]{<}P
RHit Any Key (but x) to start 2-minute timer{>}{<}SX01,{<}RC{
{062}}{>};*;[cr|lf]{<}IF{<}IS01{>}=="x"{>}{<}PRExited program.{>}
{<}GL_{>}{<}EI{>};*;[cr|lf][BX_]beep[Q2_]{<}SX02,0{>}{<}LB-A{
{062}};*;[cr|lf]{<}IF{<}PV02{>}>120{>}{<}GL-B{>}{<}EI{>};*;[cr|lf
][BX_]p 1[Q2_]{<}PR@02{>}{<}SX02,{<}PV02{>}+1{>}{<}GL-A{>}{<}
LB-B{>}[BX_]beep[Q2_]{<}GLA{>}{<}LB_{>}{<}SV50,555-598{>}[JM_
]2.clearsgts[Q2_]{<}EX{>}[cr|lf]
-nd
XPLeNCODE

XyBasic.exe also produces this kind of glossary at the bottom of its .PGM file:

  Variables & Subs                    Labels
 02 = ELAPSED_TIME           lbA =  MAIN_LOOP
 01 = RESP$

Harry Binswanger
hb@xxxxxxxx