Problem with ERR SET

This is the best place to discuss about the various Oric operating systems like Sedoric, Randos, FT-Dos, and others.
Post Reply
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Problem with ERR SET

Post by Twilighte » Sat Feb 09, 2013 10:31 pm

Hi, i'm trying to write a BASIC program in Sedoric that detects the presence of a file before loading it from disk.

However the test program below has issues

Code: Select all

10 ERR SET
20 LOAD "SILLY.MEM",V
30 ERR OFF
40 PRINT ST,ED
When run, and silly.mem does not exist on the disk the program returns to the ready prompt and doesn't show any values for ST or ED. Why?
When run, and silly.mem does exist the load parameters are displayed followed by ST and ED that line 40 prints.

I'm using Euphoric in DosBox with Sedoric 3.0 on Oric Atmos ROM V1.1

User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Re: Problem with ERR SET

Post by Twilighte » Sat Feb 09, 2013 10:37 pm

Ok, just found SEARCH command but it still doesn't explain the above.

User avatar
Symoon
Archivist
Posts: 1065
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France
Contact:

Re: Problem with ERR SET

Post by Symoon » Sun Feb 10, 2013 12:53 pm

Never used this but this is what Sedoric à Nu says about it:
"when ERR SET is on and an error occurs, the program jumps to the line specified by ERRGOTO, if it exists, or it stops, generating a Sedoric or User error message. So a ERRGOTO is required each time you use ERR SET".

User avatar
Symoon
Archivist
Posts: 1065
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France
Contact:

Re: Problem with ERR SET

Post by Symoon » Sun Feb 10, 2013 1:10 pm

Oh and BTW, each time you use ERR SET or ERR OFF, the ERRGOTO line number is erased and the program is set back to stop and print an error message. That's why ERRGOTO has to be defined after each ERR SET.

Once your ERRGOTO commands have been executed, you can resume the execution where it had crashed (RESUME), or right after the command that crashed (RESUME NEXT).

User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Re: Problem with ERR SET

Post by Twilighte » Sun Feb 10, 2013 6:51 pm

Using Sedoric's SEARCH command seems to work and doesn't generate an error if or if not found but the status must be held in a Sedoric environment variable. Any idea which one?

Dbug linked me to English Sedoric manual but it doesn't seem to hold the environment variable info. :(

User avatar
Symoon
Archivist
Posts: 1065
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France
Contact:

Re: Problem with ERR SET

Post by Symoon » Sun Feb 10, 2013 7:20 pm

Search sets the EF variable at value 1 if at least 1 file exists, and 0 if none.
So do not test it with TRUE or FALSE !
(once again, thanks to André's Sedoric à Nu ;) )

BTW this is in the French version of the manual too, page 98 with (all ?) other environment variables. Would the translation be incomplete ?

User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Re: Problem with ERR SET

Post by Twilighte » Sat Feb 16, 2013 11:59 am

It works, now in my code i have this...

Code: Select all

SEARCH L$+"-"+E$: IF EF=1 THEN LOAD L$+"-"+E$
Thanks Symoon

User avatar
Symoon
Archivist
Posts: 1065
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France
Contact:

Re: Problem with ERR SET

Post by Symoon » Sat Feb 16, 2013 7:10 pm

Glad I could help ! :wink:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest