Canon Camera Hackers Manual page 201

Camera hackers manual berthold daum
Table of Contents

Advertisement

192
C H A P T E R 5
Scripting
i = i+1
end
end
else
print(
"No configs to choose from")
end
Before we switch to the selected configuration, we check to see whether
the current configuration CHDK/CCHDK.CFG is different from the configura-
tion remembered in the INI file. We do this by using the function compare_
files() that we implemented above.
Then we ask the user whether to save the current configuration under
a new name. If yes, we remember this decision in the variable newconf. If no
INI file exists, we save the current configuration by default:
if #config_name > 0 then
local cpath =
if compare_files(
changed = true
print("Save current config?")
print("SET=yes, DISP=no")
while true do
wait_click(5000)
if is_pressed("set") then
newconf = true
break
elseif
break
end
end
end
else
newconf = true
end
If the folder CHDK/CONFIGS/ does not exist, we create it. If the current con-
figuration is to be saved under a new name, we increment the configura-
tion counter, construct a new name (confn.CFG), and copy the current
configuration to folder CHDK/CONFIGS/ under the new name. The user may
configs.."/".. config_name
current_config, cpath) then
is_pressed("display") then

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Powershot sx10 is

Table of Contents