UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

INPUTIF Syntax INPUTIF var [THEN statements] [ELSE statements] Description The UniBasic INPUTIF command retrieves input from the type-ahead buffer and assigns the input to a variable. Parameters The following table describes each parameter of the syntax. Parameter Description Related Commands UniBasic CLEARINPUT, INPUT, INPUT @, PROMPT, SYSTEM 1-393 UniBasic Commands Reference var Specifies the target variable for input data. THEN statements Executes statements if data is available in the type-ahead buffer. ELSE statements Executes statements if data is not available in the type-ahead buffer. INPUTIF Parameters

INPUTNULL Syntax INPUTNULL 'expr' Description The UniBasic INPUTNULL command enables you to change the default INPUTNULL character from the default, underscore, to any other single character. When you enter the INPUTNULL character in response to an INPUT or INPUT @ prompt, UniData stores an empty string in place of the character entered. expr specifies the character to serve as the INPUTNULL character for this session. Note: You must enclose expr in quotation marks. Example In the following example, the pound sign (#) is set as the new INPUTNULL character: PROMPT "" INPUTNULL "#" PRINT @(-1):@(0,10):"Enter a character: " INPUT @(20,10):inpt PRINT "Input is ":inpt PRINT "SEQ = ":SEQ(inpt) PRINT "LEN = ":LEN(inpt) The preceding program segment results in the following output when user input is an underscore character: Enter a character: _ Input is _ SEQ = 95 LEN = 1 INPUTNULL 1-394

INPUTNULL<br />

Syntax<br />

INPUTNULL 'expr'<br />

Description<br />

The <strong>UniBasic</strong> INPUTNULL command enables you to change the default<br />

INPUTNULL character from the default, underscore, to any other single character.<br />

When you enter the INPUTNULL character in response to an INPUT or INPUT @<br />

prompt, UniData stores an empty string in place of the character entered. expr<br />

specifies the character to serve as the INPUTNULL character for this session.<br />

Note: You must enclose expr in quotation marks.<br />

Example<br />

In the following example, the pound sign (#) is set as the new INPUTNULL<br />

character:<br />

PROMPT ""<br />

INPUTNULL "#"<br />

PRINT @(-1):@(0,10):"Enter a character: "<br />

INPUT @(20,10):inpt<br />

PRINT "Input is ":inpt<br />

PRINT "SEQ = ":SEQ(inpt)<br />

PRINT "LEN = ":LEN(inpt)<br />

The preceding program segment results in the following output when user input is an<br />

underscore character:<br />

Enter a character: _<br />

Input is _<br />

SEQ = 95<br />

LEN = 1<br />

INPUTNULL 1-394

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

Saved successfully!

Ooh no, something went wrong!