• Please review our updated Terms and Rules here

TXT file to a tokenised BAS file

ChickenMan

Experienced Member
Joined
Apr 11, 2011
Messages
91
Location
Victoria, Australia
Having scanned in 6 pages of fine text Basic listing and then OCR'ing it and converting all the 0 to O and l (small L) to 1, etc. how can I convert it to a tokenized BAS file that loads and runs. Google hasnt been my friend finding a solution. Any help appreciated. Oh, file for TRS-80 Model 1 2nd level.
 
I have an MS-BASIC tokenizer for MSX on a development branch in r8format. (It's written in Python.) It's actually good enough that I should get it moved to the main branch. I also hacked together a tokeniser for PC-8001 N-BASIC, which wasn't too hard. So this code can be re-used as the basis for other MS-BASICs.

If you're interested and have the time, I'd be happy to sit down with you and do some pair programming to add TRS-80 Level 2 BASIC to this; it shouldn't be more than a few hours work, I think. (This is obviously not as easy as just using an existing program if you can find one, though.) Feel free to PM me if you're interested.
 
Thanks for that, I used TRSTools to copy the file to Newdos-80 disk and booted that up in TRS32. Ran Basic and then used MERGE "FILE.ASC" and it loaded in until it found some error. So need to fix that and then its should load fully. Thanks.
 
Hi sorry I didn't see this earlier. While all those instructions will likely work, you can always just simply <CTL>+C copy the text file and then go into TRS32, boot to DOS basic, and then EDIT->PASTE.

In TRS32 it can take quite a long time to do this. It will be MUCH faster if you do the exact same thing, but using TRS80GP
 
Also found the emulator TRS80gp is able load in an ASCII file directly with LOAD "FILE/ASC" I then save out a "FILE/BAS". All good, but I then run the program I get a SYNTAX error in line 300 -
1707741394701.png

I've tried different disks with different Basics but all give the same error. Does anyone know of a version of Basic that accepts the statement in line 300 as above or am I missing something. Its exactly as the Basic listing is in the manual. Any help appreciated.
 
Is the original program specifically for a TRS-80 Model I? DEF FIELD is, IIRC, typically used to set up fields for disk I/O (either random file I/O or sector-based I/O).
 
The program is for a Dick Smith System 80 which is a clone of a TRS-80 Model 1 Level II. The program is called SCAP (Stock Control & Pricing) and would have came on a 5.25" disk. I now have the manual and the last 6 pages has the programs Basic listing. I scanned and OCR'e it to a TXT file, and I'm attempting to get the program running.
 
The program is for a Dick Smith System 80 which is a clone of a TRS-80 Model 1 Level II. The program is called SCAP (Stock Control & Pricing) and would have came on a 5.25" disk. I now have the manual and the last 6 pages has the programs Basic listing. I scanned and OCR'e it to a TXT file, and I'm attempting to get the program running.
It appears the program was written for Percom's OS-80/MicroDOS, which is an OS implemented as BASIC extensions (i.e., there's no DOS command line distinct from the BASIC command line). I think this was essentially the official disk BASIC for a Dick Smith System 80. See this page of the manual for the DEF FIELD instruction. See here for a disk image of OS-80/MicroDOS.
 
"DEF FIELD" is the syntax error. It's just FIELD #f, nn AS x, etc. in standard Disk BASIC. I've never seen it done with DEF before, so it must have been a rather bespoke variant of disk basic.
 
  • Like
Reactions: cjs
It appears the program was written for Percom's OS-80/MicroDOS, which is an OS implemented as BASIC extensions (i.e., there's no DOS command line distinct from the BASIC command line). I think this was essentially the official disk BASIC for a Dick Smith System 80. See this page of the manual for the DEF FIELD instruction. See here for a disk image of OS-80/MicroDOS.
Arr thats it, thanks. But now comes to problem of putting my 2 Basic listing on the Percom OS-80 disk as TRS80Tools doesnt recognize the disk format.
 
Like Ira said, just paste it into the emulator. Then you can run it or save it to disk.
Thanks for that, yes using TRS80gp I can just drag and drop the 2 ASC programs into the Percom RS L2 Basic. And they start running, but after initilization, the program stops with an error.

1707999258736.png
Not sure where to go from there. I also dont seam to be able to SAVE the program to the disk either. Write Protect is turned off.
 
Back
Top