# 5. Error Codes

During the compilation of a Chaprola source program using CHAPTRAN and CHAPCOMP (or the CHAPROLA batch file), the following error codes may be issued along with the line number where the error occurs.

## 5.1 Chaprola Error Codes

| Code | Description |
|------|-------------|
| 0013 | (unspecified) |
| 0256 | Hardware problem |
| 1001 | Length of character string is less than one |
| 1002 | Address error in reference to primary data record |
| 1003 | Address error in reference to secondary data record |
| 1004 | Address error in reference to user buffer area |
| 1005 | Address error in reference to system text memory area |
| 1008 | Invalid Chaprola procedure file (in line 0 -- uncompiled program) |
| 1009 | Illegal code in the Chaprola procedure file |
| 1011 | Reading secondary file whose record length is less than or equal to 0 (file not defined) |
| 1012 | Writing secondary file whose record length is less than or equal to 0 (file not defined) |
| 1014 | Invalid operation (e.g., disk full) |
| 1024 | Too many CALL statements (exceeds nine) |
| 1025 | Too many RETURN statements |
| 2001 | IF statement with `;` terminator missing |
| 2004 | IF statement with `;` terminator missing |
| 2005 | IF statement with `;` terminator missing |
| 2013 | IF statement with `;` terminator missing |
| 4760 | Maximum record length of secondary file has been exceeded |

## 5.2 DOS Error Codes (Version 2)

| Code | Description |
|------|-------------|
| 01 | Invalid function number |
| 02 | File not found |
| 03 | Path not found |
| 04 | Too many open files (no open handles left) |
| 05 | Access denied |
| 06 | Invalid handle |
| 07 | Memory control blocks destroyed |
| 08 | Insufficient memory |
| 09 | Invalid memory block address |
| 10 | Invalid environment |
| 11 | Invalid format |
| 12 | Invalid access code |
| 13 | Invalid data |
| 15 | Invalid disk drive |
| 16 | Attempt to remove current directory |
| 17 | Not same device |
| 18 | No more files |

### Critical Error Handler Mappings

| Code | Description |
|------|-------------|
| 19 | Disk write-protected |
| 20 | Unknown disk unit |
| 21 | Drive not ready |
| 22 | Unknown command |
| 23 | Data error (CRC) |
| 24 | Bad request structure length |
| 25 | Seek error |
| 26 | Unknown media type |
| 27 | Sector not found |
| 28 | Printer out of paper |
| 29 | Write fault |
| 30 | Read fault |
| 31 | General failure |

## 5.3 DOS Error Codes (Version 3 Additions)

| Code | Description |
|------|-------------|
| 32 | Sharing violation |
| 33 | Lock violation |
| 34 | Invalid disk change |
| 35 | FCB unavailable |
| 36 | Sharing buffer overflow |
| 50 | Network request not supported |
| 51 | Remote computer not listening |
| 52 | Duplicate name on network |
| 53 | Network name not found |
| 54 | Network busy |
| 55 | Network device no longer exists |
| 56 | Network BIOS command limit exceeded |
| 57 | Network adapter hardware error |

## 5.4 Error Recovery

| Symptom | Recovery |
|---------|----------|
| Frozen Keyboard | If there is no B in status line, press Ctrl-F2 once |
| Blank Screen | Press F3 to restore display |
| Greek Letters Appear | Press Ctrl-O (letter, not zero) |
| Record Length Problems | Screen specified does not fit data file specified |
| Disaster | Press Alt+Ctrl+Del. Changes on the displayed screen will be lost. The file ENTRY will be IN USE. |
| FILE IN USE | `>>? RESET <filename>` (e.g., `>>? RESET ENTRY`) |
| SCIOS ERROR 256 | A hardware problem exists |

---

*Previous: [Bytecodes](04-bytecodes.md) | Next: [Files](06-files.md)*
