Rockwell Automation 2708-NBD VBASIC Language Development Kit User Manual

Page 67

Advertising
background image

A-B VBASIC and Visual BASIC

Appendix B

Differences Between

B–19

TIME$ = “15450000” ‘ Sets time to 3:45:00.00

TIMER

Returns the number of seconds elapsed since midnight. As a single precision
value this is accurate to 1/100th of a second. Measurements with this
function can be in error if they span midnight. See also the EGG device.

StartTime = TIMER
FOR X = 1 TO 500: NEXT X
EndTime = TIMER
Elapsed = EndTime – StartTime

TYPE usertype

elementname AS typename
elementname AS typename

END TYPE

Defines a data type containing one or more elements. An element cannot be
the name of an array.

TYPE EmpType

Badge AS STRING * 8
Name AS STRING * 25
CodeNum AS INTEGER

END TYPE

UBOUND(array[,dimension])

Returns the upper bound (largest available subscript) for the indicated
dimension of an array. See VBDOS manual for specific details.

UCASE$(stringexpression)

Returns a string expression with all letters in uppercase.

A$ = UCASE$(“Now is the time for all...”)
A$ now contains: NOW IS THE TIME FOR ALL...

VAL(stringexpression)

Returns the numeric value of a string of digits. See VBDOS manual for
specific details.

CheckAmt$ = “123.45”
Amount = VAL(CheckAmt$)

‘Amount will now contain 123.45

WHILE condition

...[statements]

Advertising