status,val1,val2=lcon:execwait([[return get_config_value(1), get_config_value(2]])
status,val=lcon:execwait([[return {get_config_value(1), get_config_value(2)}]])
con 4> !t={};status=con:execwait([[return get_config_value(1), get_config_value(2)]],{rets=t}) ; return t={ [1]={ value=1, type="return", script_id=5, subtype="integer", }, [2]={ value=1, type="return", script_id=5, subtype="integer", },}
con 7> !t={};status=con:execwait([[return get_config_value(1), get_config_value(2)]],{rets=function(msg) table.insert(t,util.unserialize(msg.value)) return true end }) ; return t={ [1]=1, [2]=1,}
Now that I got a glimpse at LUA I really have to say that I also get a glimpse of what can NOT be done when sticking to BASIC. I don't know BASIC for CHDK, but I know as Visual Basic and some other derivates. So I can't imagine it will be completely different for CHDK.
I must say that LUA really is a very neat thing, although I had several time I had some typos which were hard to find because there is no compiler that detects such. And the fact that one has not to declare the variables in any way is also a big error potential.
I must say that LUA really is a very neat thing, although I had several time I had some typos which were hard to find because there is no compiler that detects such.
And the fact that one has not to declare the variables in any way is also a big error potential.
It is possible to use metamethods to enforce declaring variable before use, but that would require you to run all your code with an additional lua module and have some runtime performance impact. I have some code for this I should port to CHDK and chdkptp some day...
Started by Pierrinator Firmware Dumping
Started by ciaconne RAW Shooting and Processing
Started by aquilatarot « 1 2 » General Help and Assistance on using CHDK stable releases
Started by freddy40 General Discussion and Assistance
Started by Little9070 General Discussion and Assistance