Hardware manual

Commands and Functions E-H Impact Reference Guide
Datalogic Automation Inc. 5-16
This function returns the local Impact device time converted to Greenwich Mean Time (GMT) as a real
number. Example:
thistime_string = FORMATDATE ("MM-DD-YY HH:mm:ss",GMTIME) yields
thistime_string = 2-27-12 16:29:15
GOSUB
This an alternative to calling a subroutine. Program execution jumps to the line with the label indicated. (A
better way to call a subroutine is to use the Call command.) Example:
GOSUB mysub
REM After the RETURN in mysub is executed, program execution
REM returns here and executes the following code
x = 3
REM more code goes here
END
mysub:
REM mysub subroutine code is here
RETURN
GOTO
You can use this command to alter the execution order of statements. It causes execution to jump to a pro-
gram label and continue execution at that statement. The label must be local (i.e. within a program, function,
or subroutine). You cannot jump into or out of a subroutine or function. Labels must be at the start of a line
preceding a command and be followed by a colon. Example:
looplabel:
count = count+1
IF count > 50 THEN
GOTO finish
ENDIF
GOTO looplabel
finish:
count = 0
In this example, execution will loop until count reaches 50, then the command "goto finish" will cause a
jump to the label finish.
HEX()
This function returns the hexadecimal value of the integer argument as a string. Example:
hex_string = HEX(255) yields hex_string = FF
HOUR()
This function converts the real argument to an hour value. If there is no argument, it returns the hour (in
local Impact device time). Example:
thishour = HOUR yields thishour = 10