Rockwell Automation 2708-DH5B2L_DH5B4L Attended Workstation User Manual

Page 165

Advertising
background image

A-B VBASIC and Visual BASIC

Appendix L

Differences Between

L–18

SUB GetName (Name$)

DO

CLS
LINE INPUT “Enter your name: “;Name$
PRINT Name$;“Correct? “;
LINE INPUT; YN$
YN$ = UCASE$(YN$)
YN$ = “Y” or YN$ = “” THEN EXIT DO

LOOP

END SUB

SWAP vari1,vari2

Exchanges the values of two variables. See VBDOS manual for specific
details. Versions 1.0/1.1 of DH5 firmware do not support swapping single or
double precision variables. This will be corrected by future versions.

A$ = “1234”
B$ = “4321”
SWAP A$, B$ ‘A$ = “4321”, B$ = “1234”

SYSTEM

Terminates program execution. END, STOP, and SYSTEM as well as
“reaching the bottom” of a A-B VBASIC program all have the same result:
the program is terminated. Program termination causes the following:

Files are left unchanged. In particular, if HOST was OPEN, it remains

OPEN;

Status Display #8 and the corresponding read–only menu display show “End

by System”, and the offset in the program where the termination
occurred;

An error: “BASIC ERROR: End by System” is transmitted to the HOST;

Any “End by System” error message with an offset of 0 (zero) is serious and
should be reported.

TIME$

Returns the current time from the operating system. An 8 byte string is
returned in the form hhmmssnn, representing hours(0–23), minutes, seconds,
and hundredths of a second. (The Clock Mode setting of the Setup Menus
has no effect on the format of the TIME$ variable.)

CurrTime$ = TIME$

TIME$ = stringexpression

Sets the time. See preceding entry. This method of setting the actual time is
in addition to the Setup Menus and the Network Directives which allow the
host to set the time. See also DATE$.

Advertising
This manual is related to the following products: