This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
embeddedapi:devel:lua [2013/07/03 11:51] linuxmaniac [sr.xavp.get_keys] |
embeddedapi:devel:lua [2013/09/16 22:14] linuxmaniac [sr.xavp.get_keys] |
||
---|---|---|---|
Line 312: | Line 312: | ||
==== sr.xavp.get_keys ==== | ==== sr.xavp.get_keys ==== | ||
- | returns | + | returns |
Prototype | Prototype | ||
Line 331: | Line 331: | ||
t = sr.xavp.get_keys(" | t = sr.xavp.get_keys(" | ||
for k,v in pairs(t) do | for k,v in pairs(t) do | ||
- | | + | |
end | end | ||
</ | </ | ||
Line 346: | Line 346: | ||
returns a dictionary table with the values of the xavp variable. | returns a dictionary table with the values of the xavp variable. | ||
+ | Third param is optional and it choose between get all the values of a key ( 0, default) or just the first ones (1) | ||
Prototype | Prototype | ||
<code c> | <code c> | ||
- | t = sr.xavp.get(" | + | t = sr.xavp.get(" |
</ | </ | ||
Line 356: | Line 357: | ||
<code c> | <code c> | ||
- | $xavp(test=> | + | $xavp(test=> |
- | $xavp(test=> | + | $xavp(test[0]=>a) = 2; |
- | $xavp(test=> | + | $xavp(test[0]=> |
+ | $xavp(test[0]=> | ||
+ | $xavp(test[0]=> | ||
+ | $xavp(test[0]=>b) = " | ||
</ | </ | ||
<code c> | <code c> | ||
- | t = sr.xavp.get(" | + | t = sr.xavp.get(" |
+ | for k,t2 in pairs(t) do | ||
+ | for i,v in ipairs(t2) do | ||
+ | | ||
+ | end | ||
+ | end | ||
+ | |||
+ | t = sr.xavp.get(" | ||
for k,v in pairs(t) do | for k,v in pairs(t) do | ||
- | print(string.format(" | + | |
end | end | ||
</ | </ | ||
Line 371: | Line 382: | ||
<code c> | <code c> | ||
- | three: | + | a[1]: |
- | two:two[string] | + | a[2]:2[number] |
- | one: | + | a[3]: |
- | </ | + | b[1]: |
+ | b[2]: | ||
+ | b[3]: | ||
+ | a:3[number] | ||
+ | b: | ||
+ | </ | ||
===== SR.SL Package ===== | ===== SR.SL Package ===== | ||