Hardware manual

Impact Reference Guide Commands and Functions A-D
5-11 Datalogic Automation Inc.
(CPM Only) This function changes the current directory. This example changes the current directory to the
path in the quotes. Example:
chdir "C:\Documents\design docs"
CHOMP()
This function removes a trailing "newline" character from the string argument. If the last character is not a
"newline," then the original string is returned. Example:
chr_string = CHOMP(newline_string)
CHR()
This function returns the one character string corresponding to the ASCII code in the argument. If the argu-
ment is not defined, the result is a string containing a character of code zero. This example would assign the
letter "A" to the string variable chr_string. Example:
chr_string = CHR(65) yields chr_string = A
CLOSE
This function closes a previously successfully opened file. The argument is the file number that was used
when the file was opened. If the file number is not associated with a successfully opened file an error is
returned. This example closes file number 1.
close 1
COS()
This function returns the cosine of the argument. The result is in radians. If the argument is undef, the result
is undef.
x = COS(0.5) yields x = 0.8775826
CURDIR()
(CPM Only) This function returns the current directory. This example assigns the current directory name to
the string variable current_dir.
current_dir = curdir
DAY()
This function returns the number of the day corresponding to the argument. If the argument is empty, the
function returns the current day based on local Impact device time. Example:
current_day = DAY yields current_day = 27
Do
There are two versions of this construct. The first repeats the loop body until the expression following the
keyword UNTIL becomes True. The second repeats the loop until the expression following the keyword
WHILE becomes False. The expression is evaluated at the end of every loop, so the loop body is always exe-
cuted at least once.
Do
REM loop body