Output; Conditional Clauses - Canon Camera Hackers Manual

Camera hackers manual berthold daum
Table of Contents

Advertisement

86
C H A P T E R 5
Scripting

5.3.3 Output

The print command can be used to show information on the camera dis-
play. A print command can have an unlimited number of parameters. Pa-
rameters are separated by commas or by semicolons. During output, the
commas appear as space; the semicolons appear as no space. For example:
print "a:", a;"s"
will produce the output
a: 500s
if the variable a has the value of 500. Please note that an output line must
not exceed 25 characters in length.
The command print_screen allows capturing the output into a file.
print_screen n
with n > 0 switches capturing on. All output written with print will go into
file LOG_n.TXT in subfolder CHDK/LOGS/, too.
n = 0 switches capturing off. For example,
print_screen 5
print "hello"
print_screen 0
print "bye"
will produce a file LOG_0005.TXT containing the string "hello".
Finally, the command cls (clear screen) removes the output produced
with the print command from the display.

5.3.4 Conditional clauses

Conditional clauses are built with the if ... then ... else ... endif
construct. For example:
if a < 0 then
b = 3
else
b = 4
endif

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Powershot sx10 is

Table of Contents