Well Come to Professional Programmers

Learning Goal

Learning is a process to acquire, enhance, or make changes in one's knowledge. Learning Module presents essential and masks non-essential pieces of knowledge. It is self paced and presents required links to important examples and related terminologies essentially required for examination centric study. The module is focused on examination system in vogue in Pakistan and helps student acquire maximum marks in limited time of study.

Sunday, April 25, 2010

Error Codes and Messages

Error Codes and Messages


NEXT without FOR

NEXT statement does not have a corresponding FOR statement. Check variable at FOR statement for a match with the NEXT statement variable.

Syntax error

A line is encountered that contains an incorrect sequence of characters (such as unmatched parentheses, a misspelled command or statement, incorrect punctuation). This error causes GW-BASIC to display the incorrect line in edit mode.


A RETURN statement is encountered for which there is no previous GOSUB statement.

Out of DATA

A READ statement is executed when there are no DATA statements with unread data remaining in the program.

Illegal function call

An out-of-range parameter is passed to a math or string function. An illegal function call error may also occur as the result of:

  • a negative or unreasonably large subscript

  • a negative or zero argument with LOG

  • a negative argument to SQR

  • a negative mantissa with a noninteger power

  • a call to a USR function for which the starting address has not yet been given

  • an improper argument to MID$, LEFT$, RIGHT$, INP, OUT, WAIT, PEEK, POKE, TAB, SPC, STRING$, SPACE$, INSTR, or ON...GOTO



The result of a calculation is too large to be represented in GW-BASIC's number format. If underflow occurs, the result is zero, and execution continues without an error.

Out of memory

A program is too large, has too many FOR loops, GOSUBs, variables, or expressions that are too complicated. Use the CLEAR statement to set aside more stack space or memory area.

Undefined line number

A line reference in a GOTO, GOSUB, IF-THEN...ELSE, or DELETE is a nonexistent line.

Subscript out of range

An array element is referenced either with a subscript that is outside the dimensions of the array, or with the wrong number of subscripts.

Duplicate Definition

Two DIM statements are given for the same array, or a DIM statement is given for an array after the default dimension of 10 has been established for that array.

Division by zero

A division by zero is encountered in an expression, or the operation of involution results in zero being raised to a negative power. Machine infinity with the sign of the numerator is supplied as the result of the division, or positive machine infinity is supplied as the result of the involution, and execution continues.

Illegal direct

A statement that is illegal in direct mode is entered as a direct mode command.

Type mismatch

A string variable name is assigned a numeric value or vice versa; a function that expects a numeric argument is given a string argument or vice versa.

Out of string space

String variables have caused GW-BASIC to exceed the amount of free memory remaining. GW-BASIC allocates string space dynamically until it runs out of memory.

String too long

An attempt is made to create a string more than 255 characters long.


String formula too complex

A string expression is too long or too complex. Break the expression into smaller expressions.


Can't continue

An attempt is made to continue a program that

  • Has halted because of an error

  • Has been modified during a break in execution

  • Does not exist


Undefined user function

A USR function is called before the function definition (DEF statement) is given.



An error-trapping routine is entered but contains no RESUME statement.


RESUME without error

A RESUME statement is encountered before an error-trapping routine is entered.


Unprintable error

No error message is available for the existing error condition. This is usually caused by an error with an undefined error code.


Missing operand

An expression contains an operator with no operand following it.


Line buffer overflow

An attempt is made to input a line that has too many characters.


Device Timeout

GW-BASIC did not receive information from an I/O device within a predetermined amount of time.


Device Fault

Indicates a hardware error in the printer or interface card.


FOR Without NEXT

A FOR was encountered without a matching NEXT.


Out of Paper

The printer is out of paper; or, a printer fault.


Unprintable error

No error message is available for the existing error condition. This is usually caused by an error with an undefined error code.


WHILE without WEND

A WHILE statement does not have a matching WEND.


WEND without WHILE

A WEND was encountered without a matching WHILE.


Unprintable error

No error message is available for the existing error condition. This is usually caused by an error with an undefined error code.


FIELD overflow

A FIELD statement is attempting to allocate more bytes than were specified for the record length of a random file.


Internal error

An internal malfunction has occurred in GW-BASIC. Report to your dealer the conditions under which the message appeared.


Bad file number

A statement or command references a file with a file number that is not open or is out of range of file numbers specified at initialization.


File not found

A LOAD, KILL, NAME, FILES, or OPEN statement references a file that does not exist on the current diskette.


Bad file mode

An attempt is made to use PUT, GET, or LOF with a sequential file, to LOAD a random file, or to execute an OPEN with a file mode other than I, O, A, or R.


File already open

A sequential output mode OPEN is issued for a file that is already open, or a KILL is given for a file that is open.


Unprintable error

An error message is not available for the error condition which exists. This is usually caused by an error with an undefined error code.


Device I/O Error

Usually a disk I/O error, but generalized to include all I/O devices. It is a fatal error; that is, the operating system cannot recover from the error.


File already exists

The filename specified in a NAME statement is identical to a filename already in use on the diskette.


Unprintable error

No error message is available for the existing error condition. This is usually caused by an error with an undefined error code.


Disk full

All disk storage space is in use.


Input past end

An INPUT statement is executed after all the data in the file has been input, or for a null (empty) file. To avoid this error, use the EOF function to detect the end of file.


Bad record number

In a PUT or GET statement, the record number is either greater than the maximum allowed (16,777,215) or equal to zero.


Bad filename

An illegal form is used for the filename with LOAD, SAVE, KILL, or OPEN; for example, a filename with too many characters.


Unprintable error

No error message is available for the existing error condition. This is usually caused by an error with an undefined error code.


Direct statement in file

A direct statement is encountered while loading a ASCII-format file. The LOAD is terminated.


Too many files

An attempt is made to create a new file (using SAVE or OPEN) when all directory entries are full or the file specifications are invalid.


Device Unavailable

An attempt is made to open a file to a nonexistent device. It may be that hardware does not exist to support the device, such as lpt2: or lpt3:, or is disabled by the user. This occurs if an OPEN "COM1: statement is executed but the user disables RS-232 support with the /c: switch directive on the command line.


Communication buffer overflow

Occurs when a communications input statement is executed, but the input queue is already full. Use an ON ERROR GOTO statement to retry the input when this condition occurs. Subsequent inputs attempt to clear this fault unless characters continue to be received faster than the program can process them. In this case several options are available:

  • Increase the size of the COM receive buffer with the /c: switch.

  • Implement a hand-shaking protocol with the host/satellite (such as: XON/XOFF, as demonstrated in the TTY programming example) to turn transmit off long enough to catch up.

  • Use a lower baud rate for transmit and receive.


Permission Denied

This is one of three hard disk errors returned from the diskette controller.

  • An attempt has been made to write onto a diskette that is write protected.

  • Another process has attempted to access a file already in use.

  • The UNLOCK range specified does not match the preceding LOCK statement.


Disk not Ready

Occurs when the diskette drive door is open or a diskette is not in the drive. Use an ON ERROR GOTO statement to recover.


Disk media error

Occurs when the diskette controller detects a hardware or media fault. This usually indicates damaged media. Copy any existing files to a new diskette, and reformat the damaged diskette. FORMAT maps the bad tracks in the file allocation table. The remainder of the diskette is now usable.


Advanced Feature

An attempt was made to use a reserved word that is not available in this version of GW-BASIC.


Rename across disks

Occurs when an attempt is made to rename a file to a new name declared to be on a disk other than the disk specified for the old name. The naming operation is not performed.


Path/File Access Error

During an OPEN, MKDIR, CHDIR, or RMDIR operation, MS-DOS is unable to make a correct path-to-filename connection. The operation is not completed.


Path not found

During an OPEN, MKDIR, CHDIR, or RMDIR operation, MS-DOS is unable to find the path specified. The operation is not completed.


  1. Programming is very interesting and creative thing if you do it with love. Your blog code helps a lot to beginners to learn programming from basic to advance level. I really love this blog because I learn a lot from here and this process is still continuing.
    Love from Pro Programmer

  2. Programming is combination of intelligent and creative work. Programmers can do anything with code. The entire Programming tutorials that you mention here on this blog are awesome. Beginners Heap also provides latest tutorials of Programming from beginning to advance level.
    Be with us to learn programming in new and creative way.

  3. Some of the Advantages of GW Basic Programming
    The grammatical rules of GW Basic are very simple that’s way the beginners can easily it very short time.

    Another plus point of GW Basic is that it is suitable for both engineering and business applications.

    Due to soft nature of GWBASIC it easily communicate with computer. We can even develop computer games in GWBASIC and here is another important thing about GWBASIC that is it’s built in functions.
    http://www.cstechz.com/gw-basic-urdu-part-2-10-class/ also check upper link i wrote lots of thing on it