Error Registers err0 and err1

The error registers err0 and err1 are used to report errors. This is useful for script files when a user isn't necessarily around to see error messages displayed on the screen, or when an automated procedure needs to make a decision about what to do next depending on whether the last command worked okay or not.

You can use the if command to examine the error registers err0 and err1 and decide what to do next based on the results. You can use the show reg command to display the contents of err0 and err1.

err0 is used to report Autolog or system errors. err0 is 0 when the command just performed executed normally, without any error. If the command resulted in an error, err0 will be set to a number that corresponds to the appropriate error message.

err1 is used to flag whether the error occurred on the local or the remote system. err1 is 0 if the error is local, and nonzero if the error was remote (such as REMOTE device full when uploading a file).

The Autolog error codes are reported in err0 after an Autolog command results in an error. Many of the Autolog errors will only occur locally, in which case err1 will be 0, but some (especially file transfer errors) can occur remotely too (such as REMOTE file transfer cancelled), so err1 may be nonzero.

To allow more sophisticated error handling in script files, these Autolog commands do not ever change the value of the error registers:
 

abort goto if say set setmacro show system xy

These are the possible Autolog error codes reported in err0:
 
File system errors*  207 Action not defined
1 File specification error  208 Port already open
2 Insufficient free memory  209 Feature not available 
3 File not found 210  Out of memory
4 File already exists 211 Output in progress timeout 
5 Device not ready 212  Source file is older
6 Device full 213  Source file is shorter and older
7 Device error 214  Table is full
8 Device in use 215  Modem driver does not support this feature 
9 Illegal user code 216  Files have same hash code
10 Protection violation 217 Files have same version
11 Write protected 218  Unexpected packet type
12 File type mismatch 219 Batch transfer canceled
13 Device does not exist 220 File transfer canceled
14 Illegal block number 221 Miscellaneous file transfer error 
15 Buffer not initialized 222 Program must be in system memory for badly designed I/O ports 
16 File not open 223  Interface driver does not support this feature 
17 File already open 224  No emulation driver
18 Bitmap error 225  File transfer failed
19 Device not mounted 226 File transfer timed out
20 Invalid file name 227  Missing label in goto command
21 BADBLK.SYS has bad hash  228 End of file
22 BADBLK.SYS in bad format  229 Remote system cannot support wildcarding for this command 
23 BADBLK.SYS not found 230 CMDLIN.SYS required for this command (AMOS) 
24 Insufficient queue blocks  231 Illegal macro expression 
25 MFD is damaged 232  Macro expansion failed
26 First logical unit not mounted  233 Syntax error
27 Remote is not responding  234 Quoted string had bad form 
28 File in use 235  No match received
29 Record in use 236  No user activity timeout
30 Deadly embrace possible  237 Modem does not respond 
31 File cannot be deleted 238 Call aborted 
32 File cannot be renamed 239 No answer 
33 Record not locked 240  Line is busy
34 Record not locked for output  241 No dial tone 
35 LOKSER queue is full 242 Maximum go file level exceeded 
36 Device is not file structured  243 No modem driver
37 Illegal record size 244 Interface driver or COMSER.IDV required but not found 
38 Block allocate/deallocate error  245 Invalid baud rate
39 Invalid argument address  246 Not linked to remote port 
40 Invalid argument 247  No argument given
41-155 Reserved for future use  248 Invalid argument
Autolog errors 249 Command error
156 Autolog internal flag  250 Not found
157-201 Reserved for future use  251 Remote system does not respond 
202 Port is not using IRQ defined in Autfix  252 Loss of modem carrier 
203 Divide by zero 253  Transfer retry count exceeded
204 Terminated by a signal  254 Transfer check count error 
205 Macro expansion terminated  255 User interrupt
206 Action already defined 
* Some of these errors, for historic reasons, are specific to the AMOS platform and will not be reported by other operating systems.

Not all modems are capable of reporting all dialing errors. For modem-independent scripts, check for all these error codes or for just a nonzero err0.