Canon Camera Hackers Manual page 163

Camera hackers manual berthold daum
Table of Contents

Advertisement

154
C H A P T E R 5
Scripting
if e > a then
t = t + tonumber(
end
a = e + 1
end
return t * 1000
end
function parseDisp(token)
t = string.upper(token)
d = string.find("IND",t)
if d then return d - 1 end
end
The function parse() parses a whole line. It first checks to see whether a
line is a comment line. If so, it prints the comment and returns nil. Other-
wise, it sets the default values for the resulting parameters and appends a
white space character to the end of the line to make parsing easier. Then
the function searches for white space. If a white space character is found,
the text before the white space is analyzed with one of the functions de-
fined above. In case of success, the read pointer (a) is incremented, so that
parsing continues behind the white space character.
function parse(line)
if string.find(line, "%-%-")
print(string.sub(
return nil
end
line = line.." "
local n,focus,disp,met,i1,i2,a =
1,nil, nil, 0, 0, 0, 1
local e = string.find(line, " ")
if (e - a) <= 1 then
focus = parseFocus(
if focus then
a = e + 1
e = string.find(line, " ", a)
end
end
string.sub(s, a, e - 1))
== 1 then
line, 3, #line))
string.sub(line, a, e - 1))

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Powershot sx10 is

Table of Contents