EasyManua.ls Logo

Canon Camera - Page 201

Canon Camera
257 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
192 CHAPTER 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 =
configs.."/".. config_name
if compare_files(
current_config, cpath) then
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
is_pressed("display") then
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

Table of Contents

Related product manuals