Hardware manual
Commands and Functions I-L Impact Reference Guide
Datalogic Automation Inc. 5-18
The syntax of this function is
INSTRREV(base_string,sub_string[,position])
The first argument (base_string) is the string to search. The search starts from the end of the string. The sec-
ond argument (sub_string) is the string to find. The third argument is the character location to start the
search. The location of the first character of sub_string is returned. If the position argument is missing, the
search starts with the last character of base_string. Undef is returned if the sub_string is not found. Example:
location_int = INSTRREV ("basestring","string") yields location_int = 5
INT()
This function returns the integral (non-decimal) part of the argument. If the argument is a negative non-inte-
ger number, it is truncated down (more negative). If the argument is undef, the result is undef. This function
is similar to the FIX function. The difference is that INT truncates down while FIX truncates towards zero.
The two functions are identical for positive numbers. Examples:
x = INT(3.3) yields x = 3
x = INT (-3.3) yields x = -4
ISARRAY()
This function returns True if the argument is an array. Example:
list[0] = 1
list[1] = 2
check_bool = isarray(list) yields check_bool = True
ISDIRECTORY(name)
(CPM Only) This function returns True if the argument string is a directory name. This example runs the
code within the IF statement if the directory "mydirectory" exists.
if isdirectory("mydirectory") then
error_text = "no error"
else
error_text = "error: directory does not exist"
endif
ISFILE(name)
(CPM Only) This function returns True if the argument string is a file name in the current directory. This
example runs the code within the IF statement if the file "myfile" exists. IMPORTANT: File names are case
sensitive.
if isdirectory("myfile") then
error_text = "no error"
else
error_text = "error: file does not exist"
endif
ISEMPTY()
This function returns True if the argument is an empty string (contains zero characters) or undefined (undef).
Example:
variable_string = ""
check_bool = isempty(variable_string) yields check_bool = True