BASLOAD

voidstar
Posts: 445
Joined: Thu Apr 15, 2021 8:05 am

Re: BASLOAD

Post by voidstar »

Yeah, "." can work. (if no conflict with float value constants?)

But I also forgot "camel caps" in labels should also work, like "ThisLongLabel" might be good enough.


Long variables = awesome feature! Pro Edition category :)

Could the label and length be maybe 20 char instead of 12? (then it's a trade between total number of variables, I think you mentioned like ~2100 total per listing?)
voidstar
Posts: 445
Joined: Thu Apr 15, 2021 8:05 am

Re: BASLOAD

Post by voidstar »

Another feature to consider: a "no parse" option (or maybe detect if line numbers are already present in the text file) - in this mode, it just loads the input file text as if typing into the X16 BASIC. i.e. a way to load some BASIC that was prepared off-system in a text file. (otherwise I think now, we have to use -bas in the x16emu and save it back to an actual .BAS file; so an option to bring in a BASIC text file that is not dependent on the emu would be good) Maybe could be a "!I" (import) command?


NOTE for context: X16 BASIC does support two character variables already, like "AA=42". You can technically still type something like "AAZ=50" and it's not an error, but it is treated as just "AA" anyway. i.e. AAG=50, then AAH=60 will overwrite AAG. Or as in my earlier example, you could do "INPUT ANS" now, not a syntax error, but it is storing into "AN" variable. (same for string variables also)
Ed Minchau
Posts: 497
Joined: Sat Jul 11, 2020 3:30 pm

Re: BASLOAD

Post by Ed Minchau »

The way to load BASIC from an external text file is to select all, ctrl C, then in the X16, ctrl V. Pasting like that is interpreted by the X16 as if you were just typing really fast
User avatar
ahenry3068
Posts: 1082
Joined: Tue Apr 04, 2023 9:57 pm

Re: BASLOAD

Post by ahenry3068 »

Ed Minchau wrote: Sun Aug 13, 2023 7:26 pm The way to load BASIC from an external text file is to select all, ctrl C, then in the X16, ctrl V. Pasting like that is interpreted by the X16 as if you were just typing really fast
Very,,, very,,, very fast... :)
voidstar
Posts: 445
Joined: Thu Apr 15, 2021 8:05 am

Re: BASLOAD

Post by voidstar »

But I'm meaning from the SD card on the physical hardware.

Even if a NIC or UserPort transfer option is available, something will need to adapt from ISO/ASCII over into tokenized BASIC.
MarkTheStrange
Posts: 18
Joined: Sat Nov 26, 2022 6:24 pm

Re: BASLOAD

Post by MarkTheStrange »

Yeah, the equivalent of e.g. Atari BASIC's ENTER "textfile" for loading a BASIC program saved as text instead of a PRG was something I always missed in C= BASIC. You could _create_ such a file, albeit with an extra trailing READY prompt etc, with e.g. OPEN 2,8,2,"FILE.BAS,S,W":CMD2:LIST, but there's no way to read it back in.

You can't use arrays everywhere you can use a regular variable, for example as the loop control var in a for loop. So transpiling user-chosen variable names to arrays is a non-starter.

My preference would be to keep single-char varnames as-is and translate all others into first-letter + counter, so e.g. ENTRY and EXIT become E0 and E1, and after x9 you move up to xA, xB... xZ so you can have up to 36 variables of a given type starting with each letter (37 counting the single letter itself).
Stefan
Posts: 448
Joined: Thu Aug 20, 2020 8:59 am

Re: BASLOAD

Post by Stefan »

Version 0.2.2 published.

It fixes BASIC memory management by lowering the top of BASIC memory. This is to prevent BASIC programs from crashing.

It also adds support for Windows style line breaks (CRLF) when counting line numbers.
Stefan
Posts: 448
Joined: Thu Aug 20, 2020 8:59 am

Re: BASLOAD

Post by Stefan »

Version 0.2.3 published.

It adds support for a label target after the RESTORE command.
User avatar
ahenry3068
Posts: 1082
Joined: Tue Apr 04, 2023 9:57 pm

Re: BASLOAD

Post by ahenry3068 »

I have a suggestion. I don't know how hard it is to implement. Have BASLOAD drop any lines that just start with REM unless they are a target of a GOTO/GOSUB/etc.. I'm not sure how other developers are looking at this, but I'm kind of looking at BASLOAD as a psuedo-compiler. Our executables don't need to have Remarks in them only the source code we are working on. REM's take up BASIC memory.
User avatar
ahenry3068
Posts: 1082
Joined: Tue Apr 04, 2023 9:57 pm

Re: BASLOAD

Post by ahenry3068 »

ahenry3068 wrote: Wed Oct 18, 2023 8:57 am I have a suggestion. I don't know how hard it is to implement. Have BASLOAD drop any lines that just start with REM unless they are a target of a GOTO/GOSUB/etc.. I'm not sure how other developers are looking at this, but I'm kind of looking at BASLOAD as a psuedo-compiler. Our executables don't need to have Remarks in them only the source code we are working on. REM's take up BASIC memory.
I've got a ditto on this comment. At least one other programmer thinks as I do.
Post Reply