'ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ '³ PB Error Utility for PowerBASIC 3.1 ³ '³ Copyright (c) 1995 by PowerBASIC, Inc. All Rights Reserved. ³ '³ ³ '³ Return a text description for a numeric error code passed on the ³ '³ command line. ³ 'ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ $CPU 8086 ' program works on any CPU $OPTIMIZE SIZE ' make smallest possible executable $COMPILE EXE ' compile to an EXE $DEBUG MAP OFF ' turn off map file generation $DEBUG PBDEBUG OFF ' don't include pbdebug support in our executable $LIB COM OFF ' turn off PowerBASIC's communications library. $LIB CGA OFF ' turn off PowerBASIC's CGA graphics library. $LIB EGA OFF ' turn off PowerBASIC's EGA graphics library. $LIB VGA OFF ' turn off PowerBASIC's VGA graphics library. $LIB HERC OFF ' turn off PowerBASIC's hercules graphics library. $LIB LPT OFF ' turn off PowerBASIC's printer support library. $LIB IPRINT OFF ' turn off PowerBASIC's interpreted print library. $LIB FULLFLOAT OFF ' turn off PowerBASIC's floating point support. $ERROR BOUNDS OFF ' turn off bounds checking $ERROR NUMERIC OFF ' turn off numeric checking $ERROR OVERFLOW OFF ' turn off overflow checking $ERROR STACK OFF ' turn off stack checking $COM 0 ' set communications buffer to nothing $STRING 16 ' set largest string size at 16k $STACK 2048 ' let's use a 2k stack $SOUND 1 ' smallest music buffer possible $DIM ARRAY ' force arrays to be pre-dimensioned before they can ' be used $STATIC ' all arrays will be static by default $OPTION CNTLBREAK OFF ' don't allow Ctrl-Break to exit program DEFINT A-Z ' default all variables to integers for maximum ' speed and minimum size DIM ErMsg$(1:611) ErMsg$( 2) = "Syntax Error~A run-time syntax error has been created by a READ statement trying to load string data into a numeric variable. Other syntax errors are caught by the compiler." ErMsg$( 3) = "RETURN without GOSUB~A RETURN was encountered without a matching GOSUB; that is, there is nothing to RETURN from." ErMsg$( 4) = "Out of Data~A READ statement ran out of DATA statement values." ErMsg$( 5) = "Illegal function call~This is a catch-all error related to passing an inappropriate argument to some statement or function. A few of the 101 things that can cause it follow: Too large a color or screen-mode argument;"+_ " Issuing a graphics statement without a graphics adaptor, or setting the improper mode with the SCREEN statement; Trying to perform invalid mathematical operations, such as taking the square root of a negative number;"+_ " A record number is too large (or negative) in a GET or PUT; Attempting to use the WIDTH statement on a sequential file." ErMsg$( 6) = "Overflow~An overflow is the result of a calculation producing a value too large to be represented in the indicated numeric type. For example, x%=32767+1 causes overflow because 32768 can't be represented by an integer."+_ " Integer overflow errors are not detected unless the program is compiled with overflow testing enabled." ErMsg$( 7) = "Out of memory~Many different situations can cause this message, including dimensioning too large a dynamic array or too many strings to fit in available memory." ErMsg$( 9) = "Subscript out of range~You attempted to use a subscript larger than the maximum value established when the array was dimensioned. This error is not reported unless bounds testing is enabled." ErMsg$( 10) = "Duplicate definition~You attempted to dynamically dimension an array for the second time, without first erasing it." ErMsg$( 11) = "Division by zero~You attempted to divide by zero or to raise zero to a negative power." ErMsg$( 13) = "Type mismatch~You used a string value where a numeric value was expected orvice versa. This can occur in PRINT USING, DRAW, or PLAY statements." ErMsg$( 14) = "Out of string space~String storage space is exhausted." ErMsg$( 15) = "String too long~The string produced by a string expression is longer than the current string segment size. You can adjust the segment size with the $STRING metastatement." ErMsg$( 19) = "No RESUME~Program execution ran to the physical end of the program while in an error-trapping routine. There may be a missing RESUME statement in an error handler." ErMsg$( 20) = "RESUME without error~You executed a RESUME statement without an error occurring; that is, there is no error-handling subroutine to RESUME from." ErMsg$( 24) = "Device time-out~The specified time-out value for a communication status line has expired. Time-out values can be specified for the ClearToSend (CTS), CarrierDetect (CD), and DataSetReady (DSR) status lines. The program"+_ " should either abort execution or retry the communications operation. See the OPEN COM statement in Chapter 2 for further information." ErMsg$( 25) = "Device fault~A hardware error has occurred, for example, with the printer interfaceor a communications adapter." ErMsg$( 27) = "Out of paper~The printer interface indicates that the printer is out of paper. The printer can also be turned off or have some other problem." ErMsg$( 50) = "field overflow~Given the file's record length, you attempted to define too long a set of field variables in a FIELD statement." ErMsg$( 51) = "Internal error~A malfunction occurred within the PowerBASIC run-time system. Call PowerBASIC, Inc.'s Technical Support group with information about your program. (408) 659-8000 voice, (408) 659-8008 fax, (408) 659-7401 BBS." ErMsg$( 52) = "Bad file name or number~The file number you gave in a file statement doesn't match one given in an OPEN statement, or the file number may be out of the range of valid file numbers." ErMsg$( 53) = "File not found~The file name specified could not be found on the indicated drive." ErMsg$( 54) = "Bad file mode~You attempted a PUT or a GET (or PUT$ or GET$) on a sequential file." ErMsg$( 55) = "File is already open~You attempted to open a file that was already open, or you tried to delete an open file." ErMsg$( 57) = "Device I/O error~A hardware problem occurred when trying to carry out some command. You can also get this error during communications; there might've been a framing error or an overrun. The data is lost, but you can usually"+_ " 'resync' with the port using RESUME." ErMsg$( 58) = "File already exists~The new name argument specified in your NAME statement already exists." ErMsg$( 59) = "Bad record length~The length specified in a GET or PUT statement doesn't match that specified in the OPEN statement." ErMsg$( 61) = "Disk full~There isn't enough free space on the indicated or default disk to carry out a file operation. Create some more free disk space and retry your program." ErMsg$( 62) = "Input past end~You tried to read more data from a file than it had to read. Use the EOF (end of file) function to avoid this problem. This error can also be caused by trying to read from a sequential file opened for output or"+_ " append." ErMsg$( 63) = "Bad record number~A negative number or number larger than 16,777,215 was specified as the record argument to a random file PUT or GET statement." ErMsg$( 64) = "Bad file name~The file name specified in a FILES, KILL, or NAME statement contains invalid characters." ErMsg$( 67) = "Too many files~This error can be caused either by trying to create too many files in a drive's root directory, or by an invalid file name that affects the performance of the DOS Create File system call." ErMsg$( 68) = "Device unavailable~You tried to OPEN a device file on a machine without that device; for example, COM1 on a system without a serial adapter or modem." ErMsg$( 69) = "Communications buffer overflow~The Serial port received more characters than available in the communications buffer. Your program should either check and empty the buffer more often or provide a larger buffer size." ErMsg$( 70) = "Permission denied~You tried to write to a write-protected disk." ErMsg$( 71) = "Disk not ready~The door of a floppy disk drive is open, or there is no disk in the indicated drive." ErMsg$( 72) = "Disk media error~The controller board of a floppy or hard disk indicates a hard media error in one or more sectors." ErMsg$( 73) = "Feature unavailable~You tried to perform an operation which requires DOS v3.0 or later, but your system is using an earlier version. Using the OPEN, LOCK, or UNLOCK statements to set locking and/or access rights of a file will"+_ " cause this error if your system is not using the correct DOS version." ErMsg$( 74) = "Rename across disks~You can't rename a file across disk drives." ErMsg$( 75) = "Path/file access error~During a command capable of specifying a path name (OPEN, RENAME, or MKDIR, for example), you used a path inappropriately; trying to OPEN a subdirectory or to delete a directory in-use, for example." ErMsg$( 76) = "Path not found~The path you specified during a CHDIR, MKDIR, OPEN, etc., can't be found." ErMsg$(201) = "Out of stack space~You have run out of stack space. You can increase the stack space available with the $STACK metastatement. You can also reduce the amount of recursion being done by recursive procedures and functions in your"+_ " code." ErMsg$(203) = "Mismatched common variables~You attempted to CHAIN between two program segments which did not contain matching COMMON statements. PowerBASIC checks the type and number of variables in COMMON statements." ErMsg$(204) = "Mismatched program options~You attempted to CHAIN between two program segments which were compiled with different program options (different graphics library, math coprocessor required, etc.)." ErMsg$(205) = "Mismatched program revisions~You attempted to CHAIN between two program segments which were created with different versions of the PowerBASIC compiler." ErMsg$(206) = "Invalid program file~You attempted to CHAIN or RUN a program segment which was not compiled with PowerBASIC." ErMsg$(207) = "Array is static~You attempted to use DIM or REDIM on a static array parameter." ErMsg$(208) = "Invalid string handle~An invalid string handle was passed to the PowerBASIC run-time library. See error 242 for a description of the causes and solutions to this error." ErMsg$(209) = "Incompatible mouse driver~You were popping down a popup program (with POPUP SLEEP), but PowerBASIC's popup manager couldn't save the mouse state in less than 768 bytes. Most likely, an updated mouse driver solves the problem." ErMsg$(210) = "Huge array not allowed~A huge array is not allowed in this context, such as with the ARRAY statement." ErMsg$(241) = "Far heap corrupt~The Far Heap has been improperly overwritten. See Error 242 for a description of the causes and solutions to this error." ErMsg$(242) = "String memory corrupt~The string memory area has been improperly overwritten. This could be caused by the improper action of an assembler routine, by string array access outside of the dimensioned limits, by an error within the"+_ " PowerBASIC run-time system, or by a stack which is too small. If the stack is too small, increase the stack size (with the $STACK metastatement). Also try enabling Array Bounds testing." ErMsg$(243) = "CHAIN/RUN from .EXE file only~You attempted to CHAIN or RUN a program segment from within the PowerBASIC environment. You must compile your program to disk, then leave PowerBASIC and execute your program from DOS." ErMsg$(244) = "Missing library~You attempted to use a statement or function which requires a library that was not selected for inclusion in your .EXE file when your program was compiled. Recompile your program using all libraries which are"+_ " necessary for your program's operation." ErMsg$(245) = "CHAIN/RUN too big~You attempted to CHAIN or RUN to a program that couldn't fit into memory." ErMsg$(246) = "Invalid stack frame~PowerBASIC was attempting to execute an EXIT FAR branch or a local error handler but discovered and external object module's routine with an invalid stack frame." ErMsg$(256) = "Requires DOS 3.0 or later~PowerBASIC programs require DOS 2.0 or above to run. Some statements, like LOCK, require the networking features of DOS 3.0 or above." ErMsg$(257) = "Missing numeric coprocessor~You compiled the program to require a numeric coprocessor. To ensure that the program can run on machines without a numeric coprocessor, use the Emulation or Procedure floating-point library." ErMsg$(258) = "Program to big to fit in memory~The program requires more conventional memory than is available. Try unloading popup programs or other resident programs or drivers or use CHAIN." ErMsg$(259) = "80286 CPU required~You compiled the program to take advantage of 80286 or 80386 instructions, but you're trying to run the program on an 8088 machine." ErMsg$(260) = "80386 CPU required~You compiled the program to take advantage of 80386 instructions, but you're trying to run the program on an 8088 or 80286 machine." ErMsg$(401) = "Expression too complex~The expression contained too many operators/operands; break it down into two or more simplified expressions." ErMsg$(402) = "Statement too complex~The statement complexity caused an overflow of the internal compiler buffers; break the statement down into two or more simplified expressions." ErMsg$(403) = "$IF nesting overflow~Conditional compilation blocks ($IF/$ELSE/$ENDIF) can only be nested up to 16 levels deep." ErMsg$(404) = "File nesting overflow~Include files may be nested up to five levels deep, including the main program itself. That allows the program to have four nested include files." ErMsg$(405) = "Block nesting overflow~Your program has too many statement block structures nested within each other. PowerBASIC block structures may be nested 64 levels deep." ErMsg$(406) = "Compiler out of memory~Available compiler memory for symbol space, buffers, and so on, has been exhausted. If no more memory is available, separate your program into a small main program which uses the $INCLUDE metastatement to"+_ " include the rest of your program. If you are compiling your program to memory and get this error, try compiling the program to disk. You can also try the following steps: 1. Remove unnecessary line numbers"+_ " and labels. 2. Shorten your variable and procedure names. 3. Reboot your computer without AUTOEXEC.BAT or CONFIG.SYS files." ErMsg$(407) = "Too many segments~Your program contains more than 16 segments." ErMsg$(408) = "Segment exceeds 64K~Your program contains a segment which exceeds the 64K limitation. Add a $SEGMENT metastatement to your source program to force program code into another segment." ErMsg$(409) = "Variables exceed 64K~Scalar variables are limited to 64K total space. In this space, we include string handles as well as all integer, fixed-point, and floating point variables. Get rid of any unused variables or split up your"+_ " program into separate main and CHAIN modules." ErMsg$(410) = "Literals exceed 64K~String literals (such as hello in PRINT "+CHR$(34)+"hello"+CHR$(34)+") are limited to 64K total space. Reduce the length or number of your literals." ErMsg$(411) = CHR$(34)+","+CHR$(34)+" expected~The statement's syntax requires a comma (,)." ErMsg$(412) = CHR$(34)+";"+CHR$(34)+" expected~The statement's syntax requires a semicolon (;)." ErMsg$(413) = CHR$(34)+"("+CHR$(34)+" expected~The statement's syntax requires a left parenthesis (()." ErMsg$(414) = CHR$(34)+")"+CHR$(34)+" expected~The statement's syntax requires a right parenthesis ())." ErMsg$(415) = CHR$(34)+"="+CHR$(34)+" expected~The statement's syntax requires an equal sign (=)." ErMsg$(416) = CHR$(34)+"-"+CHR$(34)+" expected~The statement's syntax requires a hyphen (-)." ErMsg$(417) = CHR$(34)+"*"+CHR$(34)+" expected~The statement's syntax requires an asterisk (*)." ErMsg$(418) = "Statement expected~A PowerBASIC statement was expected. Some character could not be identified as a statement, metastatement, or variable." ErMsg$(419) = "Label/line number expected~A valid label or line-number reference was expected in an IF, GOTO, GOSUB, or ON statement." ErMsg$(420) = "Relational operator expected~The compiler has found a string operand in a position where a numeric operand should be." ErMsg$(421) = "String expression requires string~The compiler expected a string expression and found something else; for example, X$ = A$ + 3" ErMsg$(422) = "Scaler variable expected~The compiler expected a scaler variable as a formal parameter to a user-defined function. Scalar variables include strings, flex strings, integer, long integers, quad integers, single-precision,"+_ " double-precision, extended-precision and BCD fixed and floating point reals." ErMsg$(423) = "Array variable expected~An array variable was expected in a DIM statement or in the GET and PUT graphics statements." ErMsg$(424) = "Numeric variable expected~A numeric variable was expected in an INCR, DECR, or CALL ABSOLUTE statement." ErMsg$(425) = "String variable expected~A string variable was expected in a FIELD, GET$, PUT$, or LINE INPUT statement." ErMsg$(426) = "Variable expected~A variable was expected in the statement's syntax. A common cause for this error is trying to use a reserved word as a variable." ErMsg$(427) = "Integer constant expected~An integer constant was expected in a named constant assignment or a conditional compilation $IF metastatement." ErMsg$(428) = "Positive integer constant expected~A positive integer constant was expected in the array bounds for a DIM STATIC array or in the $COM, $SOUND, or $STACK metastatements." ErMsg$(429) = "String constant expected~A string constant was expected for the file name in an $INCLUDE metastatement." ErMsg$(430) = "Integer variable expected~An integer variable was expected as a parameter in a statement such as ARRAY SCAN." ErMsg$(431) = "Numeric scaler variable expected~Either a byte, word, integer, double word, long integer, quad integer, single-precision, double-precision, extended-precision, BCD fixed-point, or BCD floating-point scalar (non-array) variable is"+_ " expected; for example, in a FOR/NEXT loop." ErMsg$(432) = "Integer scaler variable expected~An integer scalar (non-array) variable was expected as a parameter in a CALL absolute statement." ErMsg$(433) = "Integer array variable expected~An integer array variable was expected; for example, in a PALETTE statement." ErMsg$(434) = "End of line expected~No characters are allows on a line (except for a comment) following a metastatement, END SUB, or statement label." ErMsg$(435) = "$IF expected~An $ENDIF conditional compilation metastatement is missing its accompanying $IF. Look for all $ENDIF metastatements and figure out where to put the associated $IF." ErMsg$(436) = "$ENDIF expected~An $IF conditional compilation metastatement is missing its accompanying $ENDIF. Look for all $IF metastatements and figure out where to put the associated $ENDIF." ErMsg$(437) = "AS expected~The AS reserved word is missing in either a variable or field buffer declaration statements." ErMsg$(438) = "FROM expected~The FROM reserved word is missing in either a FIELD or MAP statement." ErMsg$(439) = "GOSUB expected~An ON statement is missing it accompanying GOSUB part." ErMsg$(440) = "GOTO expected~An ON statement is missing it accompanying GOTO part." ErMsg$(441) = "IN expected~The IN reserved word is missing in a REPLACE statement." ErMsg$(442) = "THEN expected~An IF statement is missing its accompanying THEN part." ErMsg$(443) = "TO expected~A FIELD, FOR, or MAP statement is missing it accompanying TO part." ErMsg$(444) = "WITH expected~The WITH reserved word is missing in a REPLACE statement." ErMsg$(445) = "DEF FN expected~The compiler found an END DEF or EXIT DEF statement without a DEF FN function defined. When defining a DEF FN function, it must begin with a DEF FN statement." ErMsg$(446) = "FUNCTION expected~The compiler found an END FUNCTION or EXIT FUNCTION statement without a FUNCTION defined. When defining a FUNCTION, it must begin with a FUNCTION statement." ErMsg$(447) = "IF expected~The compiler found an END IF or an EXIT IF statement without a beginning IF statement defined." ErMsg$(448) = "DO loop expected~PowerBASIC found a LOOP of EXIT LOOP statement without a beginning DO statement defined." ErMsg$(449) = "SELECT expected~When defining a SELECT CASE statement, you either forgot to include the reserved word SELECT or the compiler ran into an END SELECT or EXIT SELECT without beginning SELECT CASE statement. This error can also occur"+_ " if your try to use the reserved word CASE as a variable name in your program." ErMsg$(450) = "CASE expected~When defining a SELECT CASE statement, you forgot to include the reserved word CASE. This error can also occur if you try to use the reserved word SELECT as a variable name in your program." ErMsg$(451) = "FOR loop expected~The compiler found an EXIT FOR statement without a beginning FOR statement defined." ErMsg$(452) = "SUB expected~The compiler found an END SUB or EXIT SUB statement without a procedure defined. You must define a procedure by beginning it with a SUB statement." ErMsg$(453) = "END DEF expected~A DEF FN function wasn't terminate with a corresponding END DEF statement." ErMsg$(454) = "END FUNCTION expected~A FUNCTION function wasn't terminated with a corresponding END FUNCTION statement." ErMsg$(455) = "END IF expected~An IF block wasn't terminated with a corresponding END IF statement." ErMsg$(456) = "LOOP/WEND expected~A DO or WHILE loop was not terminated with a corresponding LOOP or WEND statement." ErMsg$(457) = "END SELECT expected~A SELECT CASE statement was not properly terminated with an END SELECT statement." ErMsg$(458) = "END SUB expected~A procedure was not properly terminated with an END SUB statement." ErMsg$(459) = "NEXT expected~A FOR loop was not properly terminated with a NEXT statement." ErMsg$(460) = "Undefined equate~You used a named constant in your program without defining it. Define the named constant or use a literal constant in the statement." ErMsg$(461) = "Undefined FN function reference~You used an FN function name in an expression without defining the DEF FN function. Check the name of the function for mistakes or provide a definition for the function." ErMsg$(462) = "Undefined SUB/FUNCTION reference~You used CALL to a procedure, but you did not define the procedure. Check the name of the procedure for mistakes or provide the procedure. This error also occurs when you"+_ " reference a procedure which is in a unit or .OBJ module but has no corresponding DECLARE statement in the main program, or is not declared to be PUBLIC in its module." ErMsg$(463) = "Undefined label/line reference~You used a line number of label in an IF, GOTO, GOSUB, or ON statement, but you did not define the label or line number. Check the label or line number for mistakes or provide a label." ErMsg$(464) = "Undefined array reference~An array was referenced but was never defined in a DIM statement. Check the array name for mistakes or provide a DIM statement for it." ErMsg$(465) = "Duplicate definition~A program element which should only appear once was duplicated in your code (two $COMPILE metastatements, or two $STRING metastatements, for example.)" ErMsg$(466) = "Duplicate name definition~A SUB name, FUNCTION name, DEF FN name, label name, or variable name was defined more than once in your code. Check your program and any include files for duplicate names and change one or both of them." ErMsg$(467) = "Duplicate line number~The same line number was used twice. Check your program and any include files for duplicate line numbers and change one or both of them." ErMsg$(468) = "Duplicate equate~Two named constants were defined with the same name. Check your program and any include files for duplicate names and change one or both of them." ErMsg$(469) = "Duplicate common variable~Two variables with the same name were listed in a COMMON statement. Check your program and any include files for duplicate names and change one or both of them." ErMsg$(470) = "Duplicate variable declaration~Two variables with the same name have been declared with a LOCAL, STATIC, or SHARED statement. Check your program and any include files for duplicate names and change one or both of them." ErMsg$(471) = "Invalid line number~Line numbers must be in the range 0 through 65535." ErMsg$(472) = "Invalid label~A label in your code contains invalid characters." ErMsg$(473) = "Invalid numeric format~Your program declared a number with more than 18 digits or a floating-point number with an 'E' component without the exponent value." ErMsg$(474) = "Invalid name~A function, procedure, or label has an invalid name. In the case of a DEF FN function, FN must be followed by a letter and then other letters, digits, and periods optionally ended with a type identifier."+_ " In the case of a SUB procedure or FUNCTION, the name must begin with a letter and can be followed by other letters, digits, and periods, but may not include a type identifier." ErMsg$(475) = "Metastatements not allowed here~A metastatement must be the first statement on a line." ErMsg$(476) = "Block/scanned statements not allowed here~Block statements (like WHILE.WEND, DO/LOOP, and SELECT/CASE) are not allows in single line IF statements. Also, you cannot have a procedure or function definition nested within"+_ " the body of another definition." ErMsg$(477) = "Syntax error~Something is incorrect on the line--the compiler could not determine the proper error message." ErMsg$(478) = "Array subscript error~You dimensioned an array with a number of subscripts and used it with another number of subscripts." ErMsg$(479) = "Array bounds error~For a static dimensioned array, your program referenced the array with a literal value that was out of the range." ErMsg$(480) = "Type mismatch~The parameters passed to a procedure or function are not of the same type that was defined in the corresponding definition or DECLARE statement. This error also occurs when variable types in a SWAP"+_ " statement are not the same." ErMsg$(481) = "Parameter mismatch~the type or number of parameters does not correspond with the declaration of the function or procedure." ErMsg$(482) = "CLEAR parameters not allowed~The additional parameters available to the CLEAR statement in Interpretive BASIC are not available in PowerBASIC." ErMsg$(483) = "CLEAR not allowed here~CLEAR is illegal within a procedure or function." ErMsg$(484) = "Requires DEF FN/FUNCTION/SUB~You can only declare LOCAL or STATIC variables in a function or procedure." ErMsg$(485) = "Fixed-length string expected~Fixed-length strings are the only strings that can be used in record variable types. Use the 'AS STRING *' type declaration." ErMsg$(486) = "COMMON arrays must be dynamic~Arrays used in a COMMON statement must be declared DYNAMIC." ErMsg$(487) = "LOCAL arrays must be dynamic~Arrays defined as LOCAL cannot be defined as STATIC. Get rid of the STATIC specified or move the array definition out of the procedure or function and into your main program." ErMsg$(488) = "Array is already dynamic~If you have two DIM statements in a program for the same array, or if you DIMensioned an array using variables as indices, the array is automatically declared to be DYNAMIC. You"+_ " get this error messages if you try to declare such an array STATIC." ErMsg$(489) = "Array is already static~You issued a DIM STATIC statement to DIMension a static array, then later attempted to dimension that array again. Static arrays may only be DIMensioned once in a program." ErMsg$(490) = "Static array exceeds 64K~The size of a static array cannot exceeed 64K (one data segment). If you need larger arrays, use HUGE arrays." ErMsg$(491) = "Array exceeds eight dimensions~The maximum number of dimensions that can be specified for an array is eight. This is an internal limit for the compiler." ErMsg$(492) = "No parameters with INLINE SUB~you cannot specify a formal parameter list in an INLINE SUB proceudre declaration. The assembly language program is responsible for knowing the number and type of parameters"+_ " being passed to it. No type-checking is done by the compiler." ErMsg$(493) = "Compiler file not found~A $INCLUDE, $INLINE, or $LINK file could not be found in the specified directory path, current directory, or in the path specified in the Options menu. Check the directory paths or"+_ " make sure that the specified file exists." ErMsg$(494) = "ASM not allowed here~You tried using multiple statements on a line containing an ASM statement. ASM statements must be the only statement on a line." ErMsg$(495) = "Compiler file read error~When PowerBASIC tried to open the $INCLUDE, $INLINE, or $LINK file, a disk error was reported during compilation." ErMsg$(496) = "Destination file write error~While compiling to disk (an .EXE, .PBC, or .PBU file), the compiler received a disk write error. There could be a bad disk, a bad drive, or an invalid .EXE file path specified in the Options menu." ErMsg$(497) = "Asembler syntax error~You used an ASM statement that contains an invalid assembly language construction." ErMsg$(498) = "INLINE expected~INLINE was expected here for an inline sub." ErMsg$(499) = "CASE not allowed here~CASE must be the first statement on a line." ErMsg$(500) = "EXTERNAL only in units~EXTERNAL is only legal in units." ErMsg$(501) = "Nested $LINK files~A unit contains a $LINK metastatement; this is not allowed. Only the main program may contain $LINK units and .obj files. This error commonly occurs when you compile a file to a unit in the PowerBASIC"+_ " environment, then forget to set the Compile/Destination menu item to Memory or EXE file when compiling the main program, which contains a $LINK statement." ErMsg$(502) = "One Data Segment per Module~This external .OBJ module included more than one data segment, as defined by your $ALIAS meta-statements. It is not possible to link this module accurately." ErMsg$(503) = "Unresolved EXTERNAL~A variable declared EXTERNAL in a unit was not present in the main program which the unit was $LINKed to." ErMsg$(504) = "Flex variable expected~A flex string variable was expected in a FIELD or MAP statement. Check the syntax of the FIELD or MAP statements." ErMsg$(505) = "Flex array expected~A flex string array variable was expected in a MAP statement. Check the syntax of the MAP statement." ErMsg$(506) = "Declaration must precede statements~A meta statement such as $COMPILE, $CPU, etc was preceded by some executable code. You must rearrange the statements in your program so that these metastatements come first." ErMsg$(507) = "Invalid $LINK file~There is something wrong with a file $LINKed into your program. If the file is a unit file, it may have been created with a different version of the PowerBASIC compiler. If the file is a .obj file"+_ " it may contain code or declarations which violate PowerBASIC's rules for .obj files." ErMsg$(508) = "Duplicate label~The name of a label which appears in a file $LINKed into your program is the same as a label in your main program. Change one or both of the names." ErMsg$(509) = "Invalid segment name~You attempted to link a UNIT in which you specified a $CODE SEG name of DATA, or by a data name specified by $ALIAS." ErMsg$(510) = "Invalid alignment~You tried to specify 32 bit alignment." ErMsg$(511) = "$LINK buffer overflow~You don't have enough real memory available to buffer a unit or .obj for $LINK. Split the modules up. If the code segment(s) in a module are under 16k, they will always fit. If they are larger,"+_ " there must be main memory available to buffer them." ErMsg$(514) = "Invalid fixup~You tried to $LINK an .OBJ file which contains an invalid fixup requirement. For example, while it is legal to define initialized data in the 'DATA' segment (or one equated with $ALIAS), it must"+_ " contain only static constants (numbers or characters). It may not include any 'pointers' which reference a code or data label, thus requiring a link-time 'fixup'. Such pointers may only appear in a segment other than 'DATA'." ErMsg$(515) = "Fixup overflow~You tried to $LINK an .obj file containing a reference to a code or data item which is not in the segment where PowerBASIC expected it to be. A NEAR reference to an item which is in a"+_ " different segment (such as declaring the name of a public PowerBASIC routine to be NEAR instead of FAR in an EXTRN assembly directive) will cause this error." ErMsg$(517) = "Expansion memory fault~EMS or XMS reported an error." ErMsg$(519) = "Missing declaration~Means $DIM ALL etc., but you didn't DIM something." ErMsg$(520) = "TYPE expected~PowerBASIC found an END TYPE statement without a preceding TYPE statement." ErMsg$(521) = "UNION expected~PowerBASIC found an END UNION statement without a preceding UNION statement." ErMsg$(522) = "END TYPE expected~An TYPE statement was started but not closed with an END TYPE." ErMsg$(523) = "END UNION expected~A UNION statement was found but an END UNION to match was never located." ErMsg$(524) = "Undefined type~Means you specified an undefined type/member name like abc.qqq where qqq was not defined as a member." ErMsg$(525) = "Type id (?%&!#$) not allowed~You included a type id on a member in a TYPE / UNION definition." ErMsg$(526) = "Period not allowed~You included a period within a member name in a TYPE / UNION definition." ErMsg$(527) = "End of statement expected~There is an extra character at the end of a statement or line of source." ErMsg$(528) = "Type too large~TYPE /UNION definitions must be less than 16k." ErMsg$(530) = "Invalid member name~Could be a duplicate of an ID or something else." ErMsg$(531) = "Too many SUBS~This is amazing. The limit is 16000 subs." ErMsg$(532) = "Too many externals~The limit is 32000." ErMsg$(533) = "Only valid in units~Can be caused by using $CODE SEG or EXTERNAL which can only appear in a unit." ErMsg$(534) = "Not valid in units~RUN or COMMON may not appear in a UNIT." ErMsg$(535) = "Dyn/flex string variable expected~Some statements (like FIELD) require variabe length or flex strings." ErMsg$(537) = "Invalid debug file~You tried to load a program in PBD that has no debugging information or has debugging information that is corrupted or from a different version." ErMsg$(538) = "Out of expansion memory~Not enough EMS, XMS, or VMS to complete compilation." ErMsg$(601) = "Internal system error~If this error occurs, report it immediately to the PowerBASIC Technical Support Group." ErMsg$(602) = "Internal system error~If this error occurs, report it immediately to the PowerBASIC Technical Support Group." ErMsg$(603) = "Internal system error~If this error occurs, report it immediately to the PowerBASIC Technical Support Group." ErMsg$(604) = "Internal system error~If this error occurs, report it immediately to the PowerBASIC Technical Support Group." ErMsg$(605) = "Internal system error~If this error occurs, report it immediately to the PowerBASIC Technical Support Group." ErMsg$(606) = "Internal system error~If this error occurs, report it immediately to the PowerBASIC Technical Support Group." ErMsg$(607) = "Internal system error~If this error occurs, report it immediately to the PowerBASIC Technical Support Group." ErMsg$(608) = "Internal system error~If this error occurs, report it immediately to the PowerBASIC Technical Support Group." ErMsg$(609) = "Internal system error~If this error occurs, report it immediately to the PowerBASIC Technical Support Group." ErMsg$(610) = "Internal system error~If this error occurs, report it immediately to the PowerBASIC Technical Support Group." ErMsg$(611) = "Internal system error~If this error occurs, report it immediately to the PowerBASIC Technical Support Group." PRINT "PBERROR 1.0á2 þ Error Code Descriptions for PowerBASIC 3.x" PRINT "Copyright (c) 1994 by PowerBASIC, Inc. All Rights Reserved." PRINT "" IF LEN(RTRIM$(COMMAND$)) = 0 THEN PRINT " Displays a description for a given PowerBASIC error code" PRINT " passed on the command line." PRINT "" PRINT " Usage: PBERROR [errornumber]" END 1 END IF ErCode = VAL(COMMAND$) IF (ErCode > 1) AND (ErCode <= UBOUND(ErMsg$())) THEN IF LEN(ErMsg$(ErCode)) THEN Tmp$ = ErMsg$(ErCode) x = INSTR(Tmp$, "~") IF x THEN Disp$ = EXTRACT$(Tmp$,"~") Tmp$ = MID$(Tmp$, x+1) END IF PRINT " Error"+STR$(ErCode)+" - "+Disp$ PRINT "" WHILE LEN(Tmp$) PRINT " " + WordWrap$(Tmp$, 65) WEND END 0 END IF END IF PRINT " Error "+LTRIM$(STR$(ErCode))+" - Undefined!" PRINT "" PRINT " The error code you have indicated is invalid, or had not" PRINT " been defined when this utility was created." END 1 FUNCTION WordWrap$(Orig$,BYVAL Length) PUBLIC LOCAL I 'return whole string if it's shorter than "length" IF Length > LEN(Orig$) THEN WordWrap$ = Orig$ Orig$ = "" EXIT FUNCTION END IF 'search for a space char FOR I = Length TO 1 STEP -1 IF MID$(Orig$,I,1) = " " THEN EXIT FOR END IF NEXT I 'if a space was never found IF I = 0 THEN 'split the string at "length" WordWrap$ = LEFT$(Orig$, Length) Orig$ = MID$(Orig$, Length + 1) ELSE 'wrap the string, return the "rest" in Orig$ WordWrap$ = RTRIM$( LEFT$(Orig$,I) ) Orig$ = MID$(Orig$,I + 1) END IF END FUNCTION