[Coco] Giovanni Nunes’ BASIC “inliner” script
James Jones
jejones3141 at gmail.com
Fri Dec 29 12:16:45 EST 2017
It might not take much work to turn it into a BASIC version of Ratfor
(showing my age there), though targeting an interpreted language instead of
a compiled one would mean that debugging would dump you right back into the
world that something like Ratfor is intended to shield you from.
On Fri, Dec 29, 2017 at 8:34 AM, Allen Huffman <alsplace at pobox.com> wrote:
> I do not know if Giovanni is on this list, but he just posted to the
> Facebook group a link to his “inliner” script, which is similar to
> something else someone shared here in recent years:
>
> https://github.com/plainspooky/inliner/tree/master/examples
>
> It takes a BASIC program you write in a text editor, without lines
> numbers, and processes it to have line numbers. This lets you write nicely
> formatted code and use defines (kinda like C) and have code comments that
> are either included in final source, or not. You use text labels rather
> than line numbers:
>
> ‘ define MAX 100
>
> Start:
> T = RND(MAX)
>
> Ask:
> PRINT “I am thinking of a number from 1 -“;{{MAX}}
> INPUT “What is your guess?”;G
>
> IF G > {{MAX}} THEN
> \ PRINT “That is not between 1 and”;{{MAX}};
> \ GOTO {{Ask}}
>
> IF G > T THEN
> \ PRINT “Too high!”
> \ GOTO {{Ask}}
>
> IF G < T THEN
> \ PRINT “Too low!”
> \ GOTO {{Ask}}
>
> PRINT “You got it!”
> END
>
> ...or something like that.
>
> I have been doing cross development on a PC/Mac and then loading the .BAS
> file in as an ASCII file in XRoar, and any time I move lines around, I have
> to manually remember. A script like this would take care of that and could
> be added to a batch/shell script to do it automatically before coping to a
> .DSK image for loading in an emulator.
>
> I haven’t tested this script yet, but plan to check it out.
>
> I know Commodore folks have a nice cross-hosted BASIC development system
> that is pretty slick. I wonder if there is a more generic one that we could
> customize for Color BASIC.
>
> Happy Friday.
>
> — A
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>
More information about the Coco
mailing list