Locomotive BASIC emulator or equiv BASIC TGB

I have several programs which I run on an 8 bit CP/M machine (Amstrad CPC6128).  The native language of the machine is (interpretive) Locomotive Basic which has a useful feature relating to “printing”.   It uses streams 0 - 9 to which the "print" can be directed,  0 - 7 direct output to a “screen”, 8 to the printer and 9 to a file.

This means that, by changing the “stream expression”, the same coding can be used to display on the screen, print hard copy or to a file by different passes of the program.

I can convert the straight text from the Amstrad (on 3” floppy) to PC format but need to find a DOS or Windows Basic with a similar feature.  Otherwise I’ve got to triplicate each print statement and proceed with “IF stream is ??? print to screen/printer/file”.

The only other possibility is a good Locoscript emulator on the PC.  It doesn’t need to be fast nor compile.

green baron
greenbaronAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
jhanceConnect With a Mentor Commented:
How about this:

http://www.simtel.net/pub/simtelnet/msdos/emulate/myz80111.zip

It's a Z-80/CPM emulator that runs under DOS.  I've run many of my old CPM programs on it under both Windows 9x and Windows NT.  It's getting pretty old but still works perfectly.  On my PII/400, execution speed is faster than the fastest Z80 ever made!!
0
 
greenbaronAuthor Commented:
For the moment I won't accept or reject until I've had a try.  My worry is whether it will recognize the (Amstrad) Locomotive BASIC commands.
green baron
I'll be back!
0
 
vikiingCommented:
You have other approach: you can specify an OPEN statement, where you can open:
a) A file
b) The CON device
c) The PRN device

option a) directs output to a given file; b) directs to the screen and c) goes directly to the printer.

Then, you only need open a variable "file name", like:

INPUT "Your option";OP%
IF OP%=1 THEN A$="yourfile"
You have other approach: you can specify an OPEN statement, where you can open:
a) A file
b) The CON device
c) The PRN device

option a) directs output to a given file; b) directs to the screen and c) goes directly to the printer.

Then, you only need open a variable "file name", like:

INPUT "Your option";OP%
IF OP%=1 THEN A$="yourfile"
IF OP%=2 THEN A$="CON"
IF OP%=3 THEN A$="PRN"

OPEN A$ FOR OUTPUT AS #1


From there, all your output must be made thru channel #1 and voilá !!

0
SMB Security Just Got a Layer Stronger

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite.  Learn more about what this means for you and how you can improve your security with WatchGuard today!

 
greenbaronAuthor Commented:
For the moment I'll acknowledge your response until I've had time to really understand it - first reading is never enough for me!

Just to recap, the single output line in Locomotive Basic:

PRINT ch#,"stuff to be written"
(where ch is the variable I use, not a reserved word) will,
with ch=0 (to 7)send output to a screen
with ch=8 send output to the printer
with ch=9 send output to "the" file (one major restriction of Loco Basic is only one file open at a time - has made for some interesting programming in the past with much use of arrays to store either the input or output file!

I'll come back as soon as I've given your interesting idea a try
Thanks
green baron
0
 
vikiingCommented:
>>PRINT ch#,"stuff to be written"

If that's the right syntax, you only have to change ch# yo #ch and it will work smoothly.

If you keep on going on DOS environment, you can use Borland's Turbo Basic, an EXCELLENT tool for developing.
0
 
greenbaronAuthor Commented:
Yes I do have Turbo Basic and DOS is fine for these applications - thanks - the points are yours evem though I haven't tried yet.  I let you know how I get on
green baron
0
 
vikiingCommented:
Mmmm... points were already (fairly) awarded to Jhance.

Anyway, give a try to TB.
0
All Courses

From novice to tech pro — start learning today.