The problem would be on line 30 would it not?
Thanks for the reply. Yes there is a drive 3 that has the COBOL source code files.The BASIC manual I downloaded from here doesn't list any BM. Looking at the TRSDOS II manual, :2 would mean the system is checking the third drive. Does the system have 3+ drives?
I was guessing it meant Bad Media but that could be from completely different system so I am disappointed that the manual doesn't include it.
I used the IMPORT2 (see trs80gp-2.4.11.html). the file imported is a standard notepad text file that is a directory listing of an IMD diskette.?BM Error is "Bad file mode"
(source: GWDATA.ASM from the GWBASIC source code)
That means things like you've opened a file in a record-oriented mode and trying to read it in a character-oriented mode, etc. Since it's on the OPEN command, the file itself probably has an attribute that doesn't allow for text input.
AO = file already open (probably the file number, possibly the disk file)I tried opening a file on drive 3 and got this error
View attachment 1259546
I used the IMPORT2 (see trs80gp-2.4.11.html). the file imported is a standard notepad text file that is a directory listing of an IMD diskette.
I formatted a new the IMD and ran the the same command to import the DIR/TXTAO = file already open (probably the file number, possibly the disk file)
The notes regarding IMPORT2 state even if you don't provide the destination name. It uses the source name and replaces the . with a /I am a little confused. I see what you are doing though...
We seem to be swapping the '.' and '/' characters. Are we sure on which one we should be using.
The other issue is whether the file is considered to be a sequential text file or a fixed length record file. The two are not necessarily interchangeable at the BASIC level.
Dave
I tried opening the same file with using the "R" or "E" mode. But get the ?BM error. I can open it with "O" mode but can't INPUT# or LINE INPUT#. ?BM error too. I suppose I'll try a different model and/or a different OS such as LDOS or XENIX.The notes regarding IMPORT2 state even if you don't provide the destination name. It uses the source name and replaces the . with a /
I'll try opening as a direct file.
AO would be "Already Open" meaning the selected file is already open. Also, the file name within the quotes may not support the "/". You may want to check the file procedures for Random access and Sequential access. Syntax is everything within TRDOS - not very forgiving.Thanks for the reply. Yes there is a drive 3 that has the COBOL source code files.
View attachment 1259548
I tried the open with :1 (assuming that would look on drive 2) and got this error
View attachment 1259545
I tried opening a file on drive 3 and got this error
View attachment 1259546
I used the -n option but still get an errorsMy reading is that if you supply a trs80file it will use whatever name is provided. Only if you omit the trs80file is the '.' changed to a '/'.
Just thinking aloud - do you need to use the IMPORT2 -n switch to convert <newlines> into <returns>?
The other thing you didn't do in post #25 is to try and PRINT# to the file you created and then INPUT# from it.
Is it possible to 'hexdump' the file you are transferring from your host operating system (e.g. DIR.TXT) so we can physically see what it looks like?
Then can you create and PRINT# to a file and EXPORT2 it to your host filesystem and then hexdump that.
Let's see if we can understand what is actually going on.
If it is not the file contents, it may be something in the TRS-DOS directory structure.
Dave
output works,input failsUnfortunately your BASIC code is incorrect in pretty much every case I am afraid. The error reports are real!
You can't open a file for output "O" and then INPUT from it. Bad Mode.
When you then close the output file it will then be empty. So when you try to INPUT from it you will get an Empty File error.
If you open a file for INPUT "I", you can't then PRINT to it. Bad Mode error.
Your last program looks correct.
However, can you re-attempt the BASIC programs again please. OPEN for OUTPUT "O" and then PRINT to the file. OPEN for INPUT "I" and then INPUT from the file.
>>> Thanks for your assistance.
No problem, it is interesting trying to remember stuff I did so many years ago !
Dave
IMPORT2 -NE DIR.TXT DIR/TXT:1
works.Sorry, I forgot about the direct mode issue Here is a test using a program with line numbersBut haven't we already ascertained that some of the statements cannot be executed in direct mode but must form part of a program? EDIT: Yes, see post #12.
Please write a small BASIC program (with line numbers) as you did previously.
Dave