• Please review our updated Terms and Rules here

Uploading a text file for MBASIC

Yep, if i type the file in at the console, directly into MBASIC, they work as designed. It's just trying to get a text file version of a BASIC program onto the computer and saved to the disk properly. I just went with 0100h, since that is what is used for everything else.
 
As a check, try transferring and typing the same short program. Compare the BASIC files on disk. If they don't match, then the transfer method needs to be altered.
 
There seems to have been a lot derailment here.

I just tried this and if the file has LF only line-endings then I get nothing from LIST (nothing was loaded). If I add CR/LF then it works fine. So, you need to generate XXX.BAS files that have CR/LF line endings, then download them to your CP/M machine. Or run something on CP/M after download to add the CRs.
 
The best way, arguably, is to use an editor on your PC that allows you to insert the CRs. On Linux, there are utilities to convert a file between the two styles, but I don't know about Windows (I thought Windows used CR/LF, but maybe that was MS-DOS and Windows 3.11).

Failing all that, I have a utility I created for CP/NET that converts text files between CR/LF and LF. https://github.com/durgadas311/MmsCpm3/blob/master/util/bin/tr.com. Basic usage is:

TR A:{outfile}=B:infile[U|C]

Wildcards may be used in 'infile', similar to PIP. The 'U' option converts from Unix (LF) to CP/M (CR/LF). The 'C' option does the reverse. It probably does not do what you'd want if you try to use the same conversion on the same file multiple times.
 
I started doing a bit of digging, and it seems that Notepad++ may be able to do that as well. Using the extended find/replace, I can replace the control character at the end of each line with the '\r\n' sequence. Next time I need to do that I'm going to try that and see it is works.
 
I have 'tried', really 'tried' on a couple of occasions to use ED. Each time it left me cringing like when I had to use vi in Linux. Something I just am not up to the task of learning. The thought makes me shudder.... 😖
 
One easy way is to use a terminal emulator as your CP/M console and then:

1) Start MBASIC
2) Set your terminal emulator to delay 300ms after each line (e.g., TeraTerm "Transmit Delay" parameter to 300 msec/line)
3) Send the text file from the PC to CP/M machine. This essentially "types" the program into MBASIC.
4) After the file send is complete, save the file while still in MBASIC (e.g., SAVE "TEST.BAS" from within BASIC, not at the CP/M prompt).

What type of machine are you running? If XMODEM utilities exist for your machine (e.g., PCGET, PCPUT), then you can easily upload your BASIC text file from the PC directly into the CP/M file system.

Mike D
 
Back
Top