• Please review our updated Terms and Rules here

DO file execution error 24

jgrillout

Experienced Member
Joined
Jun 5, 2023
Messages
61
This link has
https://u.pcloud.link/publink/show?code=kZj9WUVZQ76IC12Q0mhtTqctqR8AsLiEOdpk
READDIR.txt a BASIC program I wrote to create a file I was hoping could be executed with the TRSDOS DO command
JOB a file created by the READDIR.txt and OUTPUT to a text file via EXPORT2
HELLO a file created with the BUILD command and OUTPUT to a text file via EXPORT2. It is contains EXPORT2 -e ACCTFILE/FD:3
XFER.IMD disk with the files above in TRS format

When I try to run the JOB file via the DO command I get an error 24. That file is on drive 2. The first line in the file is
EXPORT2 -e ACCTFILE/FD:3 and it works as shown below
Capture.PNG

I noticed the documentation for the TRSDOS DO command says it won't work for files created by BASIC. As required, I used the TRSDOS BUILD command and just typed
EXPORT2 -e ACCTFILE/FD:3

I looked at this file with a hex editor and compared it to a file I created via BASIC. The file made with BUILD has the hex value D0 in the first byte. I thought maybe if I write that value to the file I create with BASIC, that would trick the DO command would execute. Once again I realize how much TRS BASIC knowledge I used to have is gone. I looked through the manual for BASIC and can't figure out how to make the first byte of the file equal to hex D0.


Here are my attempts to figure this out. HELLO:0 is the file created via the BUILD command

10 OPEN "D",3,"HELLO:0",1
20 FIELD 3,1 AS B$
30 GET 3,1
40 LSET C$=B$
50 PRINT C$: PRINT ASC(C$)
?FC Error
Ready

>? C$

Ready
>? ASC(C$)
?FC Error
Ready
>? ASC$(C$)
?SN Error
Ready
>? HEX$(D0)
0
Ready
>? HEX$($D0)
?SN Error
>? HEX$($D0$)
?SN Error
Ready
>? $D0
?SN Error
Ready
>
Ready
>? $D0$
?SN Error
Ready
>
 
I don't see that anyone else has answered, and I am not a Model II guy, but perhaps I can help.

First, make sure the EOL delimiters in the Model II's DO file match whatever ASCII is being output from BASIC. If the DO command expects a specific character between lines, instead of the 0DH that BASIC is going to put there, you are going to need to take care of that.

Second, if you want a D0H as the first byte, then simply force it there. Line 36 would be PRINT#,CHR$(208);

But unless you mirror the EOL delimiters, you are going to hit a wall.

Ira
 
Ah, what you need is CHR$(&HD0). This little program worked for me:
Code:
10 OPEN"O",1,"BCALL:1"
20 PRINT #1,CHR$(&HD0);
30 PRINT #1,"EXPORT2"
40 CLOSE #1
Once back in TRSDOS, DO BCALL ran as expected showing the usage message of EXPORT2.
 
I don't see that anyone else has answered, and I am not a Model II guy, but perhaps I can help.

First, make sure the EOL delimiters in the Model II's DO file match whatever ASCII is being output from BASIC. If the DO command expects a specific character between lines, instead of the 0DH that BASIC is going to put there, you are going to need to take care of that.

Second, if you want a D0H as the first byte, then simply force it there. Line 36 would be PRINT#,CHR$(208);

But unless you mirror the EOL delimiters, you are going to hit a wall.

Ira
Hi Ira.
36 PRINT#3,CHR$(208);

solved the problem.
Thank you,
John
 
Back
Top