LINE INPUT Avoids INPUT Statement's "Redo from Start" Error (31161)



The information in this article applies to:

  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0

This article was previously published under Q31161

SUMMARY

To avoid the "Redo from Start" error message encountered when incorrect input is entered in response to an INPUT statement, use the LINE INPUT statement instead. (The INPUT statement's "Redo from Start" error message cannot be trapped or handled with the ON ERROR GOTO statement.)

However, because LINE INPUT accepts all characters until it encounters a carriage return, you must parse the input string yourself using string manipulation (for example, MID$, INSTR) and type conversion (for example, VAL).

MORE INFORMATION

This information applies to the following Microsoft retail BASIC products:

  1. Microsoft BASIC Compiler Versions 5.35, 5.36, 6.00, and 6.00b for MS-DOS
  2. Microsoft BASIC PDS Version 7.00 for MS-DOS and MS OS/2
  3. Microsoft BASIC Interpreter Version 5.28 for MS-DOS
  4. Microsoft GW-BASIC Interpreter Versions 3.20, 3.22, and 3.23
  5. Microsoft BASIC Interpreter Versions 1.x, 2.x, and 3.00 for the Apple Macintosh
  6. Microsoft BASIC Compiler Version 1.00 for the Apple Macintosh
  7. QuickBASIC Version 1.00 for the Apple Macintosh

Modification Type:MajorLast Reviewed:11/18/2003
Keywords:KB31161