Canon Camera Hackers Manual page 200

Camera hackers manual berthold daum
Table of Contents

Advertisement

When showing a configuration to the user, we display not only its
name, but also its modification date. This makes it easier for the user to
identify the configuration:
-- config selection
files, msg = os.listdir(
if not files then files = {} end
if #files > 0 then
table.sort(files)
local i = 1
while i <= #files do
if files[i] == config_name then
break
end
i = i + 1
end
while true do
if i <= 0 then
i = #files
elseif i > #files then
i = 1
end
cls()
print("Press SET to select")
print("LEFT/RIGHT to scroll")
print("DISP to abort")
local fstat = os.stat(
configs.."/"..files[i])
local mdate = fstat.mtime
local s = os.date("%c", mdate)
print("Switch to: "..
files[i].." ("..s..")")
wait_click(5000)
if is_pressed("set") then
selected_config = files[i]
break
elseif
is_pressed("display") then
break
elseif is_pressed("left") then
i = i - 1
elseif
is_pressed("right") then
configs,false)
5.7 Example scripts
191

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Powershot sx10 is

Table of Contents