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

DATA Syntax DATA expr1 [,expr2]... Description The UniBasic DATA command places data in an input queue stored in @DATA. ASCII character 013 (CR) delimits elements in the queue. Each subsequent INPUT statement reads one element. @DATA is read-only. For more information about @ variables, see Appendix B, “UniBasic@variables.” The expressions (expr1 and expr2) can be literal strings or variables. You can continue DATA statements over several lines by placing a comma at the end of each line to be continued. UniData places data in the queue in order of execution of DATA commands. The queue processes on a first-in, first-out basis. When the input queue is empty, UniData requests input from the terminal. The input queue remains available through program CHAIN and EXECUTE operations, but is cleared when control returns to the UniData ECL prompt (:). Tip: You can load inline prompts in paragraphs with the DATA command. For instructions, see the UniData Commands Reference. Example In the following example, the program segment executes a DATA statement containing variables and constants of both string and numeric types. The first value, 10, is read by a subsequent input statement and assigns the value to the variable COUNT. 1-187 UniBasic Commands Reference DATA 10,"William","James",TESTVAL,135, "Test Run" INPUT COUNT

DATE Syntax DATE( ) Description The UniBasic DATE function returns the current system date in internal format. Internal format is the number of days after December 31, 1967. Example The following statement prints the current system date in external format: PRINT OCONV(DATE(),"D") Related Commands UniBasic ICONV Date (D), OCONV Date (D), TIMEDATE DATE 1-188

DATA<br />

Syntax<br />

DATA expr1 [,expr2]...<br />

Description<br />

The <strong>UniBasic</strong> DATA command places data in an input queue stored in @DATA.<br />

ASCII character 013 (CR) delimits elements in the queue. Each subsequent INPUT<br />

statement reads one element. @DATA is read-only. For more information about @<br />

variables, see Appendix B, “<strong>UniBasic</strong>@variables.”<br />

The expressions (expr1 and expr2) can be literal strings or variables. You can<br />

continue DATA statements over several lines by placing a comma at the end of each<br />

line to be continued.<br />

UniData places data in the queue in order of execution of DATA commands. The<br />

queue processes on a first-in, first-out basis. When the input queue is empty, UniData<br />

requests input from the terminal. The input queue remains available through program<br />

CHAIN and EXECUTE operations, but is cleared when control returns to the<br />

UniData ECL prompt (:).<br />

Tip: You can load inline prompts in paragraphs with the DATA command. For<br />

instructions, see the UniData <strong>Commands</strong> <strong>Reference</strong>.<br />

Example<br />

In the following example, the program segment executes a DATA statement<br />

containing variables and constants of both string and numeric types. The first value,<br />

10, is read by a subsequent input statement and assigns the value to the variable<br />

COUNT.<br />

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

DATA 10,"William","James",TESTVAL,135,<br />

"Test Run"<br />

INPUT COUNT

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

Saved successfully!

Ooh no, something went wrong!