News for hackers. Stuff that matters.
Re:40-Year old BASICA utility code for teaching by ale42 on Tuesday May 21, 2024 @09:58AM (#40428592)
> Because DOS systems used CP437 encoding it is unlikely any of your editors will even be able to open the .BAS programming files in the Program directory

Actually this is not related to CP437. For normal ASCII text, CP437 and UTF-8 are identical... the problem is that BASICA/GW-BASIC were storing the source code in tokenized binary form, probably to save disk space. See for example this decoding utility: https://github.com/rwtodd/bascat

Re:40-Year old BASICA utility code for teaching by wlindley on Tuesday May 21, 2024 @10:31AM (#40428970)
Heath/Zenith's ZBASIC on the MSDOS-but-not-PCDOS Z-100 used a similar format but with at least different keywords. Somewhere I had a set of programs I had written in ZBASIC but could never load after selling that computer. Wonder if I still have the floppies squirreled away, now that I have a Greaseweazel to read those diskettes...
Re:40-Year old BASICA utility code for teaching by greenbit on Tuesday May 21, 2024 @10:25AM (#40428886)
Wasn't there a way to tell BASIC to save in ASCII, rather than tokenized? Something like sticking ",A" onto the end of the save command? Or maybe I'm thinking of gwbasic ..
Re:40-Year old BASICA utility code for teaching by ale42 on Tuesday May 21, 2024 @10:26AM (#40428907)
Not sure about BASICA, but GWBASIC definitely had this ",A" at the end of the filename to save in text format. It even had a ",P" flag to save in "protected" tokenized format (which you can't "officially" list, although a POKE at the good undocumented place could remove the flag: https://www-user.tu-chemnitz.de/~heha/hsn/chm/gwbasic.chm/to...).
Re:40-Year old BASICA utility code for teaching by livrem on Tuesday May 21, 2024 @01:01PM (#40430976)
That was a fun way to find the address and POKE it. Never knew of any of this, but it inspired me to search for more info, and it looks like there are also easier ways to unprotect files:

https://retrocomputing.stackexchange.com/questions/7104/how-...

https://slions.net/threads/deciphering-gw-basic-basica-prote...

I remember seeing some BASIC games that could not be listed. Found that very frustrating as a kid trying to learn BASIC. Maybe now I can finally get to see something of how those games were made, assuming that at least some games were only protected in this way.

Just opening the file in PC-BASIC seems to be the easiest solution: "PC-BASIC can read and write Protected files created by GW-BASIC. Unlike GW-BASIC, however, it does not disable accessing the unencrypted contents of the file. The encryption used by GW-BASIC has been broken many decades ago, so Protected mode offered little protection anyway; disallowing access is a small security hazard as it would allow someone to send you a program that you cannotinspect before running it."

Re:40-Year old BASICA utility code for teaching by lloydatkinson on Tuesday May 21, 2024 @10:16AM (#40428785)
What a weird Git repo structure. One branch for each language, instead of a directory for each language.
Re:40-Year old BASICA utility code for teaching by hedora on Tuesday May 21, 2024 @10:41AM (#40429119)
I had a colleague that did something similar. It generated a lot of confused “which branch do I check out?” slack messages.
Re:40-Year old BASICA utility code for teaching by lloydatkinson on Tuesday May 21, 2024 @11:31AM (#40429733)
It seems totally at odds with common sense. Now, every time you need to make some change across multiple branches you have to go through a lot of unnecessary pain.
Re:40-Year old BASICA utility code for teaching by throwanem on Tuesday May 21, 2024 @01:26PM (#40431308)
I'm sure, for this historical-interest repository, that that will pose a real problem.
Re:40-Year old BASICA utility code for teaching by lloydatkinson on Thursday May 23, 2024 @04:11AM (#40451937)
Well... yes? What if an another newer or older version of the code is found on a floppy or stack of printed code?
Re:40-Year old BASICA utility code for teaching by throwanem on Monday June 03, 2024 @12:39PM (#40564441)
Worry about it when it happens.

It seems like finding this version took at least half a miracle, so I feel like the potential and probably not too effortful reorganization of the repo to accommodate another is a problem worth leaving to be solved only once it's known to be worth taking the trouble.

For that matter, given manual reconciliation of two versions of very old, not previously version-controlled code would almost certainly be required anyway, the additional friction imposed by this repo structure very likely is net neutral in any case.

Re:40-Year old BASICA utility code for teaching by abdulhaq on Tuesday May 21, 2024 @11:43AM (#40429923)
Probably an ex-subversion user
Re:40-Year old BASICA utility code for teaching by norton120 on Tuesday May 21, 2024 @12:52PM (#40430867)
very cool to learn - I'll update the readme
Re:40-Year old BASICA utility code for teaching by dhosek on Tuesday May 21, 2024 @08:41PM (#40436084)
This was also a feature in Applesoft Basic, where the BASIC keywords were all tokenized to save space (and also speed up execution since the code was pre-tokenized when it was executed).