• Please review our updated Terms and Rules here

MODEL II BASIC ?BN ERROR

jgrillout

Experienced Member
Joined
Jun 5, 2023
Messages
61
I'm now realizing how much knowledge I have lost for TRS BASIC. I've looked at several manuals from the archive but can't figure out why a simple open file statement fails with the error ?BN. I was able to find that this error means Bad File number. Here is my code OPEN,"I",1,"TEST". this is a text file and I'm sure it exists. I don't have other files open. I tried file number 5 and still get the error. Thanks for any tips.
 
Just to confirm: Which BASIC for the Model II is this for? Model II Compiler BASIC is weird.

If not, the one thing that jumps to mind would be a file extension like "TEST/TXT"
 
This is the basic. I noticed it displays 0 files.
Capture.PNG
I saw in manual that this is a parameter to tell BASIC the number of file buffers to reserve
BASIC (F=5)
but that parameter didn't work. It seems it thought the parameter was a file name.
Capture.PNG
 
I found more books about TRS & BASIC. The Model 1 's BASIC actually prompts the user for how many file buffers to reserve. The default is 3.
Model II doesn't do that. I'll keep searching.
Capture.PNG
 
Thanks for asking. Yes OPEN works. I can PRINT#2,"HELLO WORLD" but haven't figured out how to INPUT#2,X$. TEST/TXT is a sequential file that only has the value
HELLO WORLD

Capture.PNG
What am I overlooking ?
 
All the error codes should be listed in the manual somewhere. What does a BM error indicate in English?

Dave
 
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 was also thinking a similar thing in that the error was not generated by BASIC but TRS-DOS and only reported by BASIC.

Dave
 
?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.
 
Back
Top