EasyManua.ls Logo

Canon Camera - Page 200

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...
5.7 Example scripts 191
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(
configs,false)
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

Table of Contents

Related product manuals