INFO: Error Codes & Descriptions for Visual Basic for MS-DOS 1.0

ID: Q99720


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0


SUMMARY

This article lists error codes, messages, and explanations for errors that can occur at run time along with some errors that can occur at compile time or bind time. Each error message appears as a heading in this article.


MORE INFORMATION

1 NEXT without FOR

This error is not trappable because it cannot occur at run time. Each NEXT statement must have a matching FOR statement as in this example:

   FOR i% = 1 TO 10>
      PRINT i%
      FOR f% = 1 to 10
         PRINT f%
      NEXT f%
   NEXT i% 
POSSIBLE SOLUTION:
Match up all FOR...NEXT pairs in each control structure, inserting additional FOR or NEXT items as required.

2 Syntax Error

  • If the error occurs at compile time, the most common cause is an misspelled keyword or argument.


  • If the error occurs at run time, you may have an incorrectly formatted DATA statement.


  • This error can occur in form code when the object specified is not found or explicit reference to the object is required.


  • This error can occur in an ISAM program if the number of keyvalues in a SEEKGT, SEEKGE, or SEEKEQ operation is incorrect.


POSSIBLE SOLUTIONS:

  • Check to verify that you have not misspelled or incorrectly formatted any of the keywords or arguments.


  • Explicitly reference the object in form code.


  • Compare the number of keyvalues in the ISAM SEEKxx operation with the number of values in the current index; reconcile as necessary.


3 RETURN without GOSUB

The program executed a RETURN statement without executing GOSUB.

POSSIBLE SOLUTIONS:
  • Insert a GOSUB statement and disable all other entry points to the SUB procedure where the RETURN statement is defined.


  • Delete the RETURN statement.


4 Out of DATA

A READ statement has been executed, but no DATA statements with unread data remain in the program.

POSSIBLE SOLUTIONS:
  • Verify that the DATA statement is accurate.


  • Delete the READ statement.


  • Use RESTORE to prepare the DATA statement to be reread.


  • Insert error checking to test for when all data has been read.


5 Illegal Function Call

You are attempting to give an improper or out-of-range argument to a Basic statement. Examples of such errors are:

  • A negative or unreasonably large subscript.


  • A negative number raised to a power that is not an integer.


  • A negative record number when using GET or PUT.


  • An I/O function or statement such as LOC or LOF on a device that does not support it.


  • Concatenated strings that create a string longer than 32,767 characters.


  • A BLOAD or BSAVE operation directed to a non-disk device.


  • A graphics statement in an invalid screen mode or when forms show.


  • A COLOR statement value not supported by the current screen mode.


  • A LOCATE statement value of 0 or a value greater than the available number of rows or columns.


  • A SCREEN statement value that is not supported by your video adapter.


  • An ISAM BEGINTRANS statement with a transaction already pending.


  • An ISAM COMMITTRANS statement without a transaction pending.


  • An ISAM ROLLBACK statement that refers to a savepoint that does not exist, or a ROLLBACK ALL statement with no transaction pending.


6 Overflow

  • The value specified is outside the allowed range of values for this data type.


  • PRINT method output has exceeded the 0 - 254 print range determined by the CurrentX and CurrentY property values.


POSSIBLE SOLUTIONS:

  • When creating a new index on an ISAM table, if 28 indexes already exist for the table, delete an index before creating a new one. The combined width of the column(s) you name for the index cannot exceed 255 bytes.


  • When opening an ISAM table, you can have a maximum of 60 long columns (arrays, user-defined types, or strings longer than 255 bytes) open.


7 Out of Memory

More memory was required for an operation than was currently available.

POSSIBLE SOLUTIONS:
  • Exit the Visual Basic programming environment (VBDOS.EXE) and restart using the /S:n command-line option. The /S:n option sets the in-memory size of the programming environment. Smaller values of n result in more conventional memory for your program. Larger values of n result in less memory but greater speed while working in the programming environment. See the Help topic "Command-Line Options" for more information.


  • Reduce the size of your MS-DOS buffers.


  • Eliminate any terminate-and-stay-resident (TSR) programs.


  • Eliminate a few of the device drivers.


  • Make your programs smaller.


  • While working in the programming environment, unload any documents, source files, or include files that are in memory but not needed.


Use the FRE function to determine the amount of memory taken up by an object or by your program.

If you are using Visual Basic and expanded memory, ensure that expanded memory is available:

  • Execute PRINT FRE(-3) in the Immediate window. The value returned shows available expanded memory.


  • If PRINT FRE(-3) causes the error message, "Feature unavailable," check to see if you are using LIM-4.0-compatible EMM memory and driver.


  • Check to see if you are making the best use of expanded memory.


You may be out of space in DGROUP even if you have space in far memory, expanded memory, or extended memory. Execute PRINT FRE(-1) in the Immediate window. If the return value is greater than 1K, free up space in DGROUP by:

  • Reducing the number of dynamic string arrays.


  • Reducing the stack size.


8 Label Not Defined

A line label is referenced (in a GOTO statement, for example), but does not occur in the program. This error is not trappable because it cannot occur at run time.

POSSIBLE SOLUTIONS:

  • Insert the line label as referenced in a GOTO or other statement.


  • If you are using the RUN statement, make sure the label is defined at the module level in a non-form code module. No executable statements are allowed at the module level of a form module.


  • ON...GOSUB and ON ERROR must refer to module-level code. Use ON LOCAL ERROR to refer to an error handler at the subroutine level.


9 Subscript Out of Range

An array element was referenced with a subscript that is outside the dimensions of the array, or an element of an undimensioned dynamic array has been accessed. You may also get this error if the following is true:

  • The array size exceeds 64K.


  • The array is not dynamic.


  • The /AH option was not used.


POSSIBLE SOLUTIONS:
  • Reduce the size of the array, make the array dynamic, and use the /AH command-line option.


  • When you use the huge /AH switch, you can declare dynamic fixed-length strings and numeric arrays to be greater than 64K. However, if you are declaring a fixed-length array or an array of user-defined types and the size of its elements isn't a power of 2 (2, 4, 8, 16), a "gap" appears in the segment blocks. At the second occurrence of a gap, the expected error occurs. You can compensate by padding that type to become a size that is a power of 2. For example:
    
          TYPE MYTYPE
             DIM A AS STRING * 10
             DIM DUMMY AS STRING *6
          END TYPE 


10 Duplicate Definition

  • A procedure has the same name as another procedure or variable.


  • You attempted to create a new element in your program and give it a name that is already being used (for example, a CONST statement with the same name as an existing variable, or a new variable or procedure with the same name as an existing procedure).


  • You attempted to create a file with the name of a file already loaded.


  • You attempted to load a file containing a non-form event procedure with the same name as an existing procedure.


  • You attempted to name a variable with the first two letters "FN."


  • You attempted to add a $FORM metacommand with a form name used in a previous $FORM metacommand.


  • For ISAM, you tried to create an index that already exists.


POSSIBLE SOLUTIONS:

  • Rename the procedure or variable.


  • Use a different constant, variable, procedure, form, or file name.


  • Cancel the command and rename or unload the conflicting file.


  • If you plan to change the dimensions of an array while your program is running, make sure it is a dynamic array and use the REDIM statement to make the change.


  • Use REDIM PRESERVE to enlarge or reduce the size of the array without losing data.


11 Division by Zero

This error is caused by dividing by zero in an expression.

POSSIBLE SOLUTIONS:

  • Check the variable values and intermediate calculations to identify the source of the miscalculation.


  • Incorporate error checking into your routine to prevent this error.


12 Illegal in Direct Mode

The highlighted statement is valid only in a program, not in the Immediate window. This error is not trappable because it cannot occur at run-time. As a rule, the following statements and metacommands cannot be used in the Immediate window:

  • COMMON, CONST, DATA, DECLARE, DIM, OPTION, SHARED, STATIC, and TYPE nonexecutable statements


  • $INCLUDE, $DYNAMIC, and $STATIC metacommands


  • DEF FN...END DEF, ELSE IF, END IF, END TYPE, FUNCTION...END FUNCTION, REDIM, and SUB...END SUB statements


13 Type Mismatch

  • The variable specified is not of the required type. For example, you tried to use the SWAP statement with a string variable and a numeric variable, or with two numeric variables of different types.


  • You tried to specify an alphanumeric label with the RUN statement.


  • In form code, you tried to specify an object that cannot be found, or explicit reference to the object is required.


  • In a multiple-module program, you have mismatched COMMON statements.


  • During an ISAM OPEN FOR operation, the data type of a record element does not match the data type of a table column.


  • During an ISAM INSERT operation, the number of elements in the record does not match the number of columns in table, or the data type of a record element does not match the data type of a table column.


  • During an ISAM RETRIEVE operation, the data type of a record element does not match the data type of a table column.


  • In an ISAM SEEKoperand statement, there is a data type mismatch between the keyvalue argument and the current index.


  • During an ISAM UPDATE operation, the record variable is not the same user-defined type as the table you are attempting to update.


14 Out of String Space

There are too many string variables for the amount of memory available. Strings compete with other types of program data for memory.

POSSIBLE SOLUTIONS:

  • In the programming environment, unload documents, source files, or include files you don't need.


  • The "Out of string space" message occurs when any one of the 64K string segments is filled or when Visual Basic cannot increase the segment size to 64K. These segments and their contents are as follows:
    
          String Segment       String Contents
          -------------------------------------------------------------------
    
          Module               Module-level string variables
                               Module-level string array elements
                               Procedure-level static string variables
                               Procedure-level static string array elements
                               Named COMMON string variables
                               Named COMMON string array elements
    
          COMMON               Strings in unnamed COMMON
                               String array elements in unnamed COMMON
    
          Local string         Procedure-level local string variables
                               Temporary strings
    
          Local string array   Procedure-level local string array elements (1)
    
          (1) NOTE: There is one local string array segment per procedure. It
              is allocated when the procedure is invoked and released when the
              procedure is exited. 


  • Find out which of the above string segments is filled by using FRE(string variable). This returns the amount of string space left in the segment where the string variable is located.


  • If one segment is filled, you can free up space by moving a string from the filled segment into another segment. For example, if the module segment is filled, you can change a module-level string to a string in unnamed COMMON.


16 String formula too complex

Either a string formula is too long, or an INPUT statement requests more than 15 string variables.

POSSIBLE SOLUTION:
Break the formula or INPUT statement into smaller parts.

18 FUNCTION not defined

This error is not trappable because it cannot occur at run-time. You must define a function before using it.

POSSIBLE SOLUTIONS:
  • Ensure the name of the function you are calling is spelled correctly.


  • Use the DECLARE statement to declare the function procedure and invoke argument data-type checking.


  • Use the DEF FN statement to define the function.


19 No RESUME

The end of the program was encountered while the program was executing an error-handling routine.

POSSIBLE SOLUTION:
Add a RESUME statement in the error-handler routine.

20 RESUME without error

A RESUME statement was executed, but there is no active error handler.

POSSIBLE SOLUTION:
Isolate the error handler from linear execution of the program with END or EXIT SUB statements.

24 Device timeout

The program did not receive information from an I/O device within a predetermined amount of time.

25 Device fault

A device has returned a hardware error indicating that you either tried to print a file when the printer is not attached to the parallel port LPT1, or you transmitted data to a communications file and the signals being tested with the OPEN COM statement were not found in the specified period of time.

16 FOR without NEXT

This error is not trappable because it cannot occur at run-time. Each FOR statement must have a matching NEXT statement. For example:

   FOR i% = 1 TO 10
      PRINT i%
      FOR x% = 1 TO 10
         PRINT x%
      NEXT x%
   NEXT i% 

17 Out of paper

The printer is out of paper.

POSSIBLE SOLUTION:
Fill the printer with paper and verify that the printer cable is securely connected to both printer and computer, the printer power is on, and the online indicator light is lit.

19 WHILE without WEND

This error is not trappable because it cannot occur at run-time. Each WHILE statement must have a matching WEND statement. For example:

   WHILE i% <> 0
      PRINT i%
      i% = (i% - 1)
      WHILE x% <> 0
         PRINT x%
         x% = (x% - 1)
      WEND
   WEND 
Verify that other control structures within the WHILE...WEND structure are correctly matched. For example, an IF without a matching ENDIF inside the WHILE...WEND structure generates this error.

The DO...LOOP statement provides a more powerful and flexible loop control structure than WHILE...WEND.

10 WEND without WHILE

This error is not trappable because it cannot occur at run-time. Each WEND statement must have a matching WHILE statement. For example:

   WHILE i% <> 0
      PRINT i%
      i% = (i% - 1)
      WHILE x% <> 0
         PRINT x%
         x% = (x% - 1)
      WEND
   WEND 
Verify that other control structures within the WHILE...WEND structure are correctly matched. For example, an IF without a matching ENDIF inside the WHILE...WEND structure generates this error.

The DO...LOOP statement provides a more powerful and flexible loop control structure than WHILE...WEND.

13 Duplicate label

Two program lines were assigned the same number or label. Each line number or label in a module must be unique. This error is not trappable because it cannot occur at run-time.

POSSIBLE SOLUTIONS:

  • Delete the highlighted item and specify a unique line label or number.


  • Check all SUB and FUNCTION procedure definitions in the module, as well as the module-level code, for the duplicate label. When you find it, rename it or delete it. In the programming environment, use the Find command from the Search menu to locate the SUB and FUNCTION procedure definitions.


15 Subprogram not defined

This error is not trappable because it cannot occur at run-time. It can be caused by any of these conditions:

  • You tried to branch to a label defined in a SUB or FUNCTION procedure or a DEF FN function from outside the procedure or function.


  • You have a RETURN statement with a target line label or line number within a SUB or FUNCTION procedure.


  • You used a STATIC statement outside a SUB or FUNCTION procedure or DEF FN function, or you used the SHARED statement outside a SUB or FUNCTION procedure.


  • You placed a RUN statement with no specified file name within a SUB or FUNCTION procedure or DEF FN function.


17 Argument-count mismatch

An incorrect number of arguments was used in a SUB or FUNCTION procedure call. This error is not trappable because it cannot occur at run-time.

POSSIBLE SOLUTIONS:

  • In the programming environment, use the Find command from the Search menu to examine the DECLARE statement.


  • Compare the DECLARE statement for the SUB or FUNCTION procedure with the CALL statement to make sure the argument list has the same number of items in both cases.


18 Array not defined

This error is not trappable because it cannot occur at run-time. It occurs when your program tries to use an array that is not defined, or when you have an undeclared function that appears to be an array. For example:

   X% = F(20) 
POSSIBLE SOLUTION: Ensure the array is defined by a DIM or REDIM statement, and verify that all functions have been declared by the DECLARE statement.

10 Variable required

At compile time, Visual Basic encountered an INPUT, LET, READ, or SHARED statement without a variable argument. Or at run time, a GET or PUT statement did not specify a variable when an operation was performed on a file opened in binary mode.

10 FIELD overflow

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

11 Internal error

An internal malfunction occurred in Visual Basic for MS-DOS. Report the conditions under which the message appeared to Microsoft Product Support.

12 Bad file name or number

  • A statement or command references a file with a number or name that is not specified in the OPEN statement or that is out of the range of file numbers specified earlier in the program.


  • An OPEN statement references a negative file number, references file number 0, or has a file number assigned with an uninitialized variable.


  • No ISAM table or any other file is currently open with the file number used in an ISAM statement or function.


  • A file exists with the file name used in an ISAM OPEN FOR statement, but it was not created by ISAM.


  • You have used an invalid file name in an ISAM OPEN FOR statement. A file name must conform to the MS-DOS naming conventions.


13 File not found

When running a program, a FILES, KILL, NAME, OPEN, PRINT, or RUN statement refers to a file that does not exist. When starting Visual Basic or when opening a file in Visual Basic, you may have a PWB .MAK file with the same base file name as your source file.

POSSIBLE SOLUTIONS:

  • Correct any file references to files that do not exist.


  • Rename the PWB .MAK file.


  • Incorporate error checking to prevent or trap this error.


54 Bad file mode

  • You attempted to load a file with an invalid format. For example, you tried to load a Visual Basic for Windows binary form file.


  • You tried to load a text file as a binary file, or vice versa.


  • A PUT or GET statement specified a sequential file.


  • A FIELD statement specified a file not opened for random access.


  • A PRINT # statement specified a sequential file opened for input.


  • An INPUT # statement specified a file opened for output or appending.


  • Visual Basic tried to use an include file previously saved in binary format. Include files must be saved in text format.


  • An ISAM statement or function file-number argument refers to an open file that is not an ISAM table.


  • You are using the CHAIN or RUN statement and errors have occurred. For example, the program you ran using the RUN statement may contain duplicate procedure names.


POSSIBLE SOLUTIONS:

  • Resave the file in text format and reload as a text file.


  • Resave the file in binary format and reload as a binary file.


  • Verify the correct file criteria for your PUT, GET, FIELD, PRINT #, or INPUT # statements.


  • Reload the include file, save it in text format, then rerun the program.


  • Make sure all ISAM file references refer to the correct file type.


  • If you are using the CHAIN or RUN statement, loading all files into the programming environment may give additional information on the type of errors encountered.


15 File already open

  • A sequential-output-mode OPEN statement has been executed for a file that is already open.


  • You tried to open two different files using the same file number. For example:
    
          OPEN "A.TXT" FOR OUTPUT AS #1
          OPEN "B.TXT" FOR RANDOM AS #1 


  • A KILL statement refers to an open file.


  • The file named in an ISAM OPEN FOR statement is already open for ISAM.


  • A file with the same name as the file argument in an ISAM OPEN FOR statement is already open for another access mode.


56 FIELD statement active

A GET or PUT statement specified a record variable on a file for which FIELD statements have already been executed. GET or PUT with a record-variable argument can be used only on files where no FIELD statements have been executed.

57 Device I/O error

An input or output error occurred while your program was using a device such as the printer or a disk drive.

58 File already exists

The file name specified in a NAME statement is identical to a file name already in use on the disk.

POSSIBLE SOLUTIONS:

  • Rename the file.


  • Specify a different file.


  • Delete the duplicate file.


19 Bad record length

A GET or PUT statement was executed that specified a record variable whose length did not match the record length specified in the corresponding OPEN statement.

11 Disk full

Either there isn't enough room on the disk to complete a PRINT #, WRITE #, or CLOSE operation, or there isn't enough room for Visual Basic to write out an object or executable file.

12 Input past end of file

An INPUT # statement read from a null (empty) file or from a file in which all data has already been read.

POSSIBLE SOLUTION:
Use the EOF function to detect the end of file.

63 Bad record number

The record number in a PUT or GET statement was less than or equal to zero.

POSSIBLE SOLUTION: Use the LOC function to detect the current position within an open file.

64 Bad file name

Either a file name does not follow the appropriate naming convention for BLOAD, BSAVE, KILL, or OPEN (for example, the file name has too many characters), or you are trying to load an invalid project file (Visual Basic for Windows, NMAKE/PWB) into Visual Basic for MS-DOS.

67 Too many files

At compile time, this error occurs when include files are nested more than five levels deep. At run time, the following can cause this error:
  • Visual Basic limits the number of disk files that can be open at one time. You can only open 20 files -- including five files that are used by the operating system. This is true no matter what you set the FILES= command to in the CONFIG.SYS file.


  • The operating system limits the number of entries in a root directory.


  • ISAM limits the number of databases and tables that can be open at one time and your program has exceeded this limit.




POSSIBLE SOLUTIONS:

  • Increase the number of files defined by FILES= in CONFIG.SYS and reboot your computer.


  • If your program is opening, closing, or saving files in the root directory, change your program so it uses a subdirectory.


  • ISAM can open up to 4 databases and 4 to 13 tables depending on the number of databases open). Change your program so it closes tables or databases that exceed this limit.


68 Device unavailable

You tried to open a file that is not online or does not exist.

POSSIBLE SOLUTIONS:

  • Verify the device is connected to your computer.


  • Verify the device's power is on.


  • Change the specified device name to a valid name.


69 Communication-buffer overflow

During remote communications, the receive buffer overflowed. The size of the receive buffer is set by the /C command-line option or the RB option in the OPEN COM statement.

POSSIBLE SOLUTION:
Check the buffer frequently by using the LOC function, and empty the buffer frequently by using the INPUT$ function.

70 Permission denied

You tried to write to a write-protected disk, to access a locked file, or to use UNLOCK on a file that was not locked.

POSSIBLE SOLUTIONS:

  • Remove write-protection from the disk.


  • Unlock the file before attempting access.


  • Lock the file before trying to unlock it.


  • Remove the UNLOCK statement.


  • Insert error checking to test for disk/file status before attempting WRITE or UNLOCK operations.


71 Disk not ready

There is no disk is in the disk drive, or the disk-drive door is open.

POSSIBLE SOLUTION:
Insert a disk in the disk drive, and make sure the disk-drive door is closed.

72 Disk-media error

Disk-drive hardware has detected a physical flaw on the disk.

POSSIBLE SOLUTION:
Use a different disk.

73 Feature unavailable

The following can cause this error:

  • You tried to perform an ISAM operation without the correct ISAM TSR loaded (PROISAM or PROISAMD), or you tried to use FRE(-3) when no expanded memory was available.


  • You tried to use a feature of another version of Basic that is not available in this version of Microsoft Visual Basic for MS-DOS, or you tried to use a feature of Basic that is unavailable in the operating system you are running. For example you can't use the LOCK or UNLOCK statement while running MS-DOS version 2.1.


74 Rename across disks

You attempted to rename a file with a new drive designation, which you cannot do in Visual Basic.

POSSIBLE SOLUTION:
Rename the file on the current disk. Then copy it to the new drive location.

75 Path/File access error

Either during an OPEN, MKDIR, CHDIR, or RMDIR operation, the operating system was unable to make a correct connection between the path and file name, or you tried to save a file that replaces an existing read-only file. If a project (.MAK) file is read-only, the entire program cannot be saved.

POSSIBLE SOLUTIONS:

  • In the programming environment, make sure the file name you entered in the text box is formatted correctly. Any file name can contain a full or partial path:

    • A full path starts with the drive name.


    • A partial path has one or more directory names before the file name, but does not include a drive name.




  • From MS-DOS, use the ATTRIB command to change the read-only status of the specified file.


76 Path not found

During an OPEN, MKDIR, CHDIR, or RMDIR operation, the operating system was unable to find the path specified.

POSSIBLE SOLUTION:
Verify the path specified exists. For example, a path specified in the Options.Path dialog may not be valid. If you are creating the path, make sure you don't reference the path until after it is created.

80 Feature removed

You removed this feature by linking with a stub file.

POSSIBLE SOLUTION:
Relink your program without a stub file.

81 Invalid name

The rules of naming an ISAM object (such as a table, column, or index) are different from the rules for naming a Visual Basic object (such as a variable or procedure). For example, ISAM names:

  • Have no more than 30 characters.


  • Use only the characters A-Z, a-z, and 0-9.


  • Begin with an alphabetic character.


POSSIBLE SOLUTION:
Verify that your ISAM object adheres to the ISAM naming conventions defined above and change the reference as required.

82 Table not found

A DELETEINDEX statement references a table that does not exist.

POSSIBLE SOLUTIONS:

  • Verify that you have not misspelled the table name.


  • Create an ISAM table with the name referenced in the DELETEINDEX statement.


13 Index not found

There is no index with the specified name for the ISAM table referenced by a file number argument in a DELETEINDEX or SETINDEX statement.

POSSIBLE SOLUTIONS:

  • Verify that you have not misspelled the index name.


  • Create an ISAM table index with the name referenced in the statement.


84 Invalid column

When opening a file for ISAM and specifying a data type, you referenced an element name that is not a column name. Or when creating an ISAM index, you named a column that does not exist or that has a data type that cannot be indexed (an array or user-defined type).

POSSIBLE SOLUTION:
Verify that all element names referenced when opening the ISAM file are valid column names, and when creating an ISAM index, verify that columns exist and are not arrays or user-defined types.

85 No current record

There was no current record to delete, retrieve, or update when an ISAM DELETE, RETRIEVE or UPDATE statement was executed. Or an ISAM MOVENEXT or MOVEPREVIOUS statement was executed on a file that does not have a next or previous record.

86 Duplicate value for unique index

Either a unique index is current for an ISAM table, and the user attempted to enter a value that is already in the column, or a CREATEINDEX statement was executed with a nonzero unique argument value, and the existing columns already contain values that are not unique.

POSSIBLE SOLUTIONS:

  • Type a unique value in the column.


  • Change the column values to eliminate duplicates and retry the CREATEINDEX statement.


87 Invalid operation on NULL index

You cannot perform an ISAM MOVELAST or SEEK operation on a NULL index.

POSSIBLE SOLUTIONS:

  • Verify that you have not misspelled the index name.


  • Remove the MOVELAST or SEEK statement.


88 Database needs repair

An OPEN FOR ISAM statement attempted to open a file that needs repair.

POSSIBLE SOLUTION:
Use the ISAMREPR.EXE utility to recover (restore physical integrity to) the database.

89 Insufficient ISAM buffers

There are not enough buffers to handle ISAM file processing.

POSSIBLE SOLUTION:
When you invoke BC.EXE or VBDOS.EXE, use the /Ib command-line option to increase the number of ISAM buffers.

260 No timer available

  • There are too many active timer controls. You can have up to 16 timer controls on an individual form, but only 16 timer controls total may be active at any one time within your application.


  • There is not enough memory to load a timer control.




POSSIBLE SOLUTION: Remove some of the timer controls on the active form.

271 Invalid screen mode

You tried to unload or show forms in an invalid screen mode. For example:

SUB Form_Load()
SCREEN 9
END SUB 
POSSIBLE SOLUTION:
Use the SCREEN statement to set the screen mode to 0 before forms are displayed. In some cases, you will also need to use the WIDTH statement to reset the screen width to 80 columns. For example:

SCREEN.HIDE
SCREEN 7
COLOR 7, 4
CIRCLE STEP(0, 0), 100, , , , 5 /25
SLEEP 2
WIDTH 80
SCREEN 0
SCREEN.SHOW 

272 Invalid when forms are showing

You tried to use a function or statement that is not available when forms are showing.

POSSIBLE SOLUTIONS:

  • Use the HIDE method to hide forms before executing any graphics or other statements not supported when forms are showing.


  • Use the SCREEN object with the HIDE method to hide all visible forms. For example:
    
    SCREEN.HIDE 


340 Control array element does not exist

You used an index value that does not correspond to an existing element in the specified control array.

POSSIBLE SOLUTION:
Adjust the value or load a control into the array with an index equal to the value specified.

341 Invalid object array index

You used a negative index value or one that falls outside the valid range. The index for an object array element cannot be less than 0 or greater than 32,767.

POSSIBLE SOLUTION:
Change the array index to a value within the valid range.

342 Not enough room to allocate control array

There isn't enough memory to create all the elements of a control array. Each form is limited to 64K for controls and data.

POSSIBLE SOLUTIONS:

  • Reduce the number of other controls on the form.


  • Reduce the number or length of control data.


  • Move some of the controls to another form.


343 Object not an array

A control that is not part of any array was referenced as if it had an index. For example:

Command1(3).Caption 
Reference an object as an array element only if it is defined as part of a control array.

POSSIBLE SOLUTIONS:

  • Remove the control array part of the object reference.


  • Create a control array that matches the specification.


344 Must specify index for object array

The referenced control is part of a control array. Use this syntax instead:

ctlname(index).Index 
ctlname is the name of the control and index is the value of the control's Index property. If you created the control at design time, find the index of the control by selecting it and viewing its Index property.

POSSIBLE SOLUTION:
Include the control array index in the object reference.

345 Reached limit: cannot create any more controls for this form

No more than 255 menu items or controls are allowed on each form.

POSSIBLE SOLUTION:
Redesign your application so that a second form holds some of the controls.

360 Object already loaded

You tried to load a control array element that is already been loaded.

POSSIBLE SOLUTIONS:

  • If the control array element is hidden, show it by setting its Visible property to True (-1) at design time.


  • If the object was loaded at run time, you can remove it using the UNLOAD statement.


361 Can't load or unload this object

Either you tried to load or unload one of the special objects SCREEN, PRINTER, or CLIPBOARD, or you tried to load or unload a control that is not an element of an existing control array.

POSSIBLE SOLUTION:
Compare the LOAD or UNLOAD statement syntax you are using with the Help syntax and reconcile any differences.

362 Can't unload controls created at design time

Only control array elements loaded at run time can be unloaded. If a control is created at design time, it cannot later be unloaded, even if it is part of a control array.

POSSIBLE SOLUTION:
Hide the control by setting the Visible property to False (0).

364 Object was unloaded

You tried to unload an object that has already been unloaded. For example, you may have unloaded a form from its own Form_Load event procedure while an implicit load occurred. For example:

Form1.BackColor = Form2.BackColor 
POSSIBLE SOLUTIONS:

  • Remove the UNLOAD statement from the form's Load event procedure.


  • Verify that you are not trying to unload an object that has already been removed from memory.


365 Unable to unload within this context

In the following situations, you are not allowed to unload a form or a control on a form:

  • During any Paint event for the form or any control on the form.


  • Whenever a combo box control is opened either on the form being unloaded or on the form that contains the control being unloaded.




POSSIBLE SOLUTION:
Remove the UNLOAD statement from the Paint event procedure or disable the combo box during the Unload event.

380 Invalid property value

An inappropriate value is assigned to a property. To find out which values are valid for a property, see the property's Help topic.

POSSIBLE SOLUTION:
Compare valid settings in the property's Help topic to the setting you specified and reconcile.

381 Invalid property array index

You tried to use an inappropriate property array index value. List property index values must be greater than 0 and less than 32,767. For example, the following is valid:

List1.List(3) 
POSSIBLE SOLUTION:
Change the array index to a value in the valid range.

382 Property can't be set at run time

The following properties cannot be set at run time:

- BorderStyle (form/text box only)      - ControlBox
- CtlName                               - FormName
- Index                                 - List
- ListCount                             - MaxButton
- MinButton                             - MultiLine
- ScrollBars                            - Sorted
- Style                                 - Text (list/combo box only)
- Width (SCREEN/combo box only) 
POSSIBLE SOLUTIONS:

  • Set the property values at design time rather than run time.


  • Change the property reference to read the value rather than set it.


383 Property is read-only

The following properties are read-only at design time and run time:

Property Object


ActiveControl  Any control
ActiveForm     Form
Height         Combo box (Style = 1), drive list box, and PRINTER
Left(1)        Form when attached scroll bars are present
List           Directory list box, drive list box, and file list box
ListCount      Combo box, directory list box, drive list box, file list
box, and list box
Parent         Any control
Text           Combo box (Style = 2), and list box
Top(1)         Form when attached scroll bars are present
Width          PRINTER

(1) Left and Top are read-only at run time only when the implied form
contains attached scroll bars; that is, when Attached = True. 
POSSIBLE SOLUTION:
Change the property reference to read the value rather than set it.

384 Property can't be modified when form is minimized or maximized

The Left, Top, Height, and Width properties cannot be changed on a minimized or maximized form.

POSSIBLE SOLUTIONS:

  • Set or return the state of a form using the WindowState property.


  • Prevent the user from maximizing or minimizing a form by setting the form's MaxButton or MinButton properties to False (0).


385 Must specify index when using property array

You must specify an index when using the List property. Index values must be greater than 0 and less than 32,767. For example:

List1.List 
> This is invalid because no index is specified. However, the following is valid because an index is specified:

List1.List(3) 
POSSIBLE SOLUTION:
Include an index specification with the List property.

386 Property not available at run time

The CtlName and FormName properties are not available at run time.

POSSIBLE SOLUTIONS:

  • Delete the CtlName or FormName property reference.


  • Set the CtlName or FormName property at design time.


  • Use the Tag property to pass an identification string at run time.


387 Property can't be set on this control

  • The Checked property for a menu control can't be selected when that control is a top-level menu title.


  • The Separator property for a menu control can't be set when the control is a top-level menu title.


  • The Visible property can't be set to False(0) for the last visible submenu on a parent menu. You can't have a parent menu with no visible submenu items.




POSSIBLE SOLUTION:
Change your reference to the Checked, Separator, or Visible property to conform to the usage rules outlined above.

400 Form already displayed; can't show form modally

Don't use the SHOW method to display a modal form that is already visible.

POSSIBLE SOLUTIONS:
  • Do not try to display the form as a modal form.


  • Unload or hide the form before trying to display it as a modal form.


401 Can't show non-modal form when modal form is displayed

This error occurs after a Form_Load event procedure attempts to make a non-modal form visible.

POSSIBLE SOLUTION:
Unload or hide the modal form before trying to use the SHOW method on another form.

402 Must close or hide topmost modal form first

The modal form you tried to close or hide is not on top. A modal form is a form displayed by the SHOW method with the style% argument equal to 1.

POSSIBLE SOLUTION:
Unload or hide all modal forms that are on top of this one before you continue.

403 MDI form cannot be shown modally

A form with its FormType property set to 1 - MDI cannot be modal.

POSSIBLE SOLUTIONS:

  • Remove or change the style% argument you specified with the SHOW method.


  • Change the form's FormType property to 0 - Normal and execute the existing SHOW method again.


410 Property can't be modified on MDI form

Because an MDI form is always maximized, any property setting that attempts to change this status can also cause an error. Such properties include Top, Left, Width, and Height.

POSSIBLE SOLUTION:
Explicitly reference a non-MDI form when setting the value of this property.

420 Invalid object reference

The referenced object is not loaded.

POSSIBLE SOLUTION:
Use the LOAD statement or SHOW method to load the specified object before referencing it.

421 Method not applicable for this object

You tried to use a method that is not available for use with the specified object. For example, the following produces this error because the ADDITEM method is used only with a list or combo box control:

Command1.ADDITEM 
POSSIBLE SOLUTIONS:

  • Check the method's topic in Help for a list of applicable controls and change the reference as required.


  • Check the object's topic in Help for a list of applicable methods and change the reference as required.


422 Property not found

You tried to reference a property that is not available for use with the specified control.

POSSIBLE SOLUTIONS:

  • Check to make sure you have correctly spelled the property name.


  • Check the control's topic in Help for a list of applicable properties. Then change reference as required.


423 Property or control not found

You tried to reference a control or property that is not defined for the specified form.

POSSIBLE SOLUTIONS:

  • Check to make sure you have correctly spelled the property name.


  • Check the form topic in Help for a list of applicable properties, and change the reference as required.


  • Choose Event Procedures from the Edit menu (Alt+E,V) to display a list of the controls on this form, and change the control name reference.


424 Object required

You referenced a property without including explicit reference to the active form or control.

POSSIBLE SOLUTION:
Change the property reference to explicitly include the active form or control name.

425 Invalid object use

You attempted an invalid assignment using a form or control. To assign a value to a property or a property value to a variable, remember to include the property name in the object specification. For example:

Form1.Command1.Caption = "OK" 
POSSIBLE SOLUTION:
Include the property name in the object reference.

430 No currently active control

No control has the focus, so the ActiveControl property has no effect.

POSSIBLE SOLUTION:
Use the SETFOCUS method to set the focus to a specified object.

431 No currently active form

No form has the focus, so the ActiveForm property has no effect.

POSSIBLE SOLUTION:
Use the SETFOCUS method to set the focus to an object.

480 Can't create AutoRedraw image

There isn't enough memory available to create a persistent background image for an automatic redraw of the form or picture.

POSSIBLE SOLUTIONS:

  • Make the picture box or form smaller.


  • Reset the AutoRedraw property to False (0) and redraw the object using the Paint event procedure.


Unprintable error

An error message is not available for the error condition that exists.

POSSIBLE SOLUTION:
An ERROR statement is using an error-code argument value for which Visual Basic has no error message string.

Additional query words:

Keywords :
Version : MS-DOS:1.0
Platform : MS-DOS
Issue type :


Last Reviewed: December 2, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.