Rockwell Automation 2708-DH5B2L_DH5B4L Attended Workstation User Manual

Page 156

Advertising
background image

A-B VBASIC and Visual BASIC

Appendix L

Differences Between

L–9

END IF

LOOP
UpdateTime:
LOCATE 1, 1, 0
PRINT LEFT$(CurrTime$,2); “:”; RIGHT$(CurrTime$,2);
RETURN

GOTO {linelabel/linenumber}

Branches unconditionally to the specified line. See VBDOS manual for
detailed information.

HEX$(expression)

Returns a string that represents the hexadecimal argument expression. See
VBDOS manual for detailed information.

IF...THEN...ELSE

Allows conditional execution, based on the evaluation of a Boolean
expression. See VBDOS manual for detailed information.

IF (A > B) AND (C > D) THEN

Sum = (A – B) + C

ELSEIF (A < B) AND (C < D) THEN

Sum = (B – A) * D

ELSE

Sum = A * C

END IF

INKEY$

Reads a character from the keyboard. If no key is currently being pressed, it
returns a null string. All key codes in a DH5 terminal are a single byte. The
codes corresponding to special keys can vary due to differences in keypad
configurations. If necessary, use this function to get a keystroke, convert it
using ASC, then print the result.

A$ = “”
DO WHILE A$ = “”

A$ = INKEY$

LOOP

INPUT$(bytecount[,[#]filenumber])

Returns a string read from the specified file. A common error is switching
the byte count and the filenumber. To prevent this, always use the # symbol
with the filenumber even though it’s optional. See the chapter on Special
Devices for details on INPUT$ from particular devices.

J$ = INPUT$(LOC(1),#1)

Advertising
This manual is related to the following products: