Problem with ERR SET

This is the best place to discuss about the various Oric operating systems like Sedoric, Randos, FT-Dos, and others, as well as serious software, utilities, word processors, disassemblers, etc... that runs on oric computers.
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 »

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 »

Ok, just found SEARCH command but it still doesn't explain the above.
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Problem with ERR SET

Post by Symoon »

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: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Problem with ERR SET

Post by Symoon »

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 »

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: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Problem with ERR SET

Post by Symoon »

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 »

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: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Problem with ERR SET

Post by Symoon »

Glad I could help ! :wink:
User avatar
ibisum
Wing Commander
Posts: 1643
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: Problem with ERR SET

Post by ibisum »

Did anyone end up translating the full Sedoric A Nu to English?
Post Reply