• Please review our updated Terms and Rules here

How to LOAD an ASCII file into Basic Level II

ChickenMan

Experienced Member
Joined
Apr 11, 2011
Messages
91
Location
Victoria, Australia
Is there any way to load an ASCII file, originally written via Notepad in Windows, into Disc BASIC (NEWDOS/80) on a Model 1 ? There is no mention it can be done in the manual and Google hasnt been helpful. Is there a Windows program that can convert it also ?
I wrote a simple file in Notepad and saved as TEST.BAS and transferred to a virtual disk with TRSTools and then booted the disk in both TRS32 and TRS80gp

1 REM *** TEST ***
2 FORX=1TO10
3 PRINT"HELLO WORLD"
4 NEXTX

and use LOAD "TEST/BAS" and it seams to load and you end up at READY. LIST shows nothing and RUN does nothing. If I try load a larger file I get "DIRECT STATEMENT IN FILE"

Any help appreciated, thanks
Alan
 
Shouldn't that be LOAD "TEST.BAS" or just LOAD "TEST"? Or was that just a typo. I know BASIC will assume a .BAS file if not told. Do you need to put it in quotes or is that just to show the command? Haven't used BASIC in a long time, but this seems what I remember.
 
If I read the manual correctly, an ASCII file could be loaded into BASIC through the MERGE command. The BASIC won't LOAD an ASCII file directly, only tokenized BASIC files.

MERGE "TEST/BAS" looks like the command within BASIC to load the contents of an ASCII called "TEST.BAS" on the other system.
 
Hi ChickenMan

Alan Try this, On the model 1 under Disk Basic Type the program
Save using this " Save test.asc,A (The a will leave it as ascii)"
type NEW
Load," test.asc"

List

Keep Safe

Ray
 
First off, file extensions are delimited with "/" in TRS-DOS so you always want to LOAD"TEST/BAS" or what have you.

The technique you're using should work. But in trs80gp you can also simply paste the code at the BASIC prompt. That is, boot trs80gp into BASIC. Then select all the text in notepad and use Edit -> Paste (or right click, Paste) to have it "typed" into trs80gp.

That should at least provide a baseline.

I'm not sure if trstools does line ending conversion. Windows text files end lines with <CR> <LF>. TRS-DOS only wants the <CR>. That could be the problem.
 
First off, file extensions are delimited with "/" in TRS-DOS so you always want to LOAD"TEST/BAS" or what have you.

The technique you're using should work. But in trs80gp you can also simply paste the code at the BASIC prompt. That is, boot trs80gp into BASIC. Then select all the text in notepad and use Edit -> Paste (or right click, Paste) to have it "typed" into trs80gp.

That should at least provide a baseline.

I'm not sure if trstools does line ending conversion. Windows text files end lines with <CR> <LF>. TRS-DOS only wants the <CR>. That could be the problem.

Fantastic, thats works really great and easy to use, just Cut & Paste from Windows and then SAVE. I've always used TRS32 as my emulator in the past and tried TRS80GP for the first time today so never really knew about it. All my text files had been converted to UNIX type also.

Thanks to everyone and appreciated :)
Alan
 
Hi All

I have just Gunned up my Clunky System-80

Booted into Newdos-80

Basic (Go into Disk Basic)

Typed in :-

10 for X=32 to 192

20 Print chr$(x);

30 Next x

Save”test/asc”,a (to save as ascii)

It saved OK

Then NEW and LIST (Nothing showing)

Load”Test/asc”

List and the listing was there.

Therefore ascii xxxx/asc files can be used

Hope that this is of some help

Keep Safe

Ray
 
Thanks Ray, I will try it on my System 80 later, just that TRS32 & TRS80gp dont seam to allow that. Anyway, I got all 8 Dick Smith programs on the one disk and with a very simple menu I "borrowed" from another disk, all is now good.
218263397_813493302553026_8630645057389415062_n.png
 
And when in Disk Basic the command CMD "S" will get you back to TRSDOS. While you are back in TRSDOS
give this command a try:

LIST "TEST/ASC" (ASCII)


The File I used as TEST/ASC was terminated with 0x0D 0x0A. Nedit can save files with line endings as DOS, MAC, UNIX.

DOS 0x0D 0x0A
UNIX 0x0D
WINDOWS 0x0A


Larry
 
Last edited:
Back
Top