11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

INPUTERR<br />

Syntax<br />

INPUTERR error.expr<br />

Description<br />

The <strong>UniBasic</strong> INPUTERR command displays an error message at the bottom line of<br />

the terminal screen. error.expr can be any valid <strong>UniBasic</strong> statement, including a<br />

literal string enclosed in quotation marks.<br />

Tip: Use INPUTERR to prompt for errors when soliciting data with an INPUT<br />

statement.<br />

The next INPUT command erases previous error messages printed on the bottom line<br />

of the screen. The <strong>UniBasic</strong> program must control the movement of the cursor so it<br />

does not enter the bottom line.<br />

Note: INPUTERR sends output to the screen regardless of PRINTER on/off status.<br />

Example<br />

In the following example, the program segment prints an error message at the bottom<br />

of the screen if the input does not match the pattern mask:<br />

1-391 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

PRINT @(-1)<br />

PRINT @(5,5):'Hourly Wage'<br />

LOOP<br />

PRINT @(16,5)<br />

INPUT HOURLY.WAGE<br />

UNTIL HOURLY.WAGE MATCHES '1NON.2N'<br />

INPUTERR 'Hourly wage must be entered as x.xx'<br />

REPEAT<br />

PRINT @(5,7):'Accepted.'<br />

END

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!