Hardware manual

Impact Reference Guide Commands and Functions W-Y
5-29 Datalogic Automation Inc.
UCASE()
This function converts the string argument to all upper case. If the argument is undef, the result is undef. In
this example, the string "ALL UPPERCASE" is assigned to the variable var_string. Example:
var_string = UCASE("All Uppercase") yields var_string = ALL UPPERCASE
UNDEF
Impact Basic uses a special constant named "undef." This constant is undefined in the sense that it has no
value (it is not zero or false and it is not any data type). Array elements that have no value assigned to them
are undef. If any variables in a mathematical operation are undef, the result of the operation is undef.
You can test for undef values with the function ISUNDEF (see page 5-19). This function assigns the value
"undef" to a variable. Example:
undef my_int yields an undefined value for my_int
VAL()
This function converts a string argument to a number. If the argument is undef, the result is undef. Example:
var_real = VAL("10.9") yields var_real = 10.9
Commands and Functions W-Y
WEEKDAY()
This function converts the real argument to a number corresponding to the day of the week. (Sunday is
weekday number zero, Saturday is weekday number six.) If there is no argument, it returns the current week-
day number (in local Impact device time). Example:
thisday = WEEKDAY (TIMEVALUE (2005,12,23)) yields thisday = 5
While
This construct repeats the loop body while the expression is True. The expression is evaluated before enter-
ing the loop, so the loop is not executed if the expression is already False.
While expression
REM loop body
Wend
YEAR()
This function converts the argument to a number corresponding to the current year. If there is no argument, it
returns the current year (in local Impact device time). Example:
thisyear = YEAR yields thisyear = 2012
YEARDAY
This function converts the argument to a number corresponding to the current day of the year. (The first day
of the year is number zero.) If there is no argument, it returns the current day of the year (in local Impact
device time). Example: