Correct useage of USR ?

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Correct useage of USR ?

Post by stefano »

Good to know, so.. the interpreter will switch to the next BASIC line, correct ?
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: Correct useage of USR ?

Post by siggi »

Yes.
I often use such code:

PRINT USR xxx, <params>
IF PEEK <ERRNO> THEN GOTO ERRORHANDLER

where ERRNO is a byte in the system variable area, which is set by the USR routine to its return code: 0 for no error and > 0 to indicate an error (like in C ;-)

Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
Post Reply