Fundamental 1.4.0 question : Is this where we finally make a break and "fix" all the Lua functions that return 0/1 rather than false/true like they probably should ?
An "expected chdk version" indicator might be useful in the long run, but we'd have to keep it simple enough to actually be usable.
bi=get_buildinfo()chdk_version= tonumber(string.sub(bi.build_number,1,1))*100 + tonumber(string.sub(bi.build_number,3,3))*10 + tonumber(string.sub(bi.build_number,5,5))if ( tonumber(bi.build_revision) > 0 ) then build = tonumber(bi.build_revision)else build = tonumber(string.match(bi.build_number,'-(%d+)$'))endif ((chdk_version<120) or ((chdk_version==120)and(build<3276)) or ((chdk_version==130)and(build<3383))) then printf("CHDK 1.2.0 build 3276 or higher required")else
My fear in all of this is making something so complicated it just causes more trouble and confusion.
function ckeck_version(version, revision)... if not needed_version then print("You need a recent CHDK version") return false else return true endend
Quote from: reyalp on 21 / December / 2014, 18:45:45My fear in all of this is making something so complicated it just causes more trouble and confusion.That's also my opinion.
Btw., it's not the best time to discuss about essential developments on so many fronts (changeover 1.3 => 1.4, long file name, new script header, script compatibly, palette system, touchscreen UI, GPS, shooting hooks).
A function or module for a version/revision check should be enough. An update of CHDK needs some minutes.Code: [Select]function ckeck_version(version, revision)... if not needed_version then print("You need a recent CHDK version") ...
function ckeck_version(version, revision)... if not needed_version then print("You need a recent CHDK version") ...
Btw., it's not the best time to discuss about essential developments on so many fronts (changeover 1.3 => 1.4, long file name, new script header, script compatiblity, pallette system, touchscreen UI, GPS, shooting hooks).
So we have some choices:1) Maintain backward compatibility forever2) Just warn users in the documentation that their scripts may break when they change CHDK versions, and break compatibility if we need to.3) Come up with a way of indicating which version the script was intended for.
@requires 1.4 3838
E.G.Code: [Select]@requires 1.4 3838The requirements can be checked when the header is parsed and an error dialog shown if they are not met. It would also support uBasic if needed.
Started by tileboy1 General Help and Assistance on using CHDK stable releases
Started by Alarik General Discussion and Assistance
Started by brunobg Script Writing
Started by Yariv Script Writing
Started by jeż « 1 2 3 » Script Writing