[Coco] Giovanni Nunes’ BASIC “inliner” script

Allen Huffman alsplace at pobox.com
Fri Dec 29 09:34:47 EST 2017


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



More information about the Coco mailing list