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/09 16:38] linuxmaniac [sr.xavp.get_keys] |
embeddedapi:devel:lua [2014/01/03 16:16] linuxmaniac [sr.xavp.get] |
||
---|---|---|---|
Line 312: | Line 312: | ||
==== sr.xavp.get_keys ==== | ==== sr.xavp.get_keys ==== | ||
- | returns | + | returns |
Prototype | Prototype | ||
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) | ||
+ | |||
+ | If second param is nil will return all indexes. If second param is <0 will return the index counting from then end ( -1 is the last value ) | ||
Prototype | Prototype | ||
<code c> | <code c> | ||
- | t = sr.xavp.get("xavp_name", 1) | + | sr.xavp.get(xavp_name, |
</ | </ | ||
Line 356: | Line 359: | ||
<code c> | <code c> | ||
+ | $xavp(test=> | ||
+ | $xavp(test[0]=> | ||
+ | $xavp(test[0]=> | ||
+ | $xavp(test[0]=> | ||
+ | $xavp(test[0]=> | ||
+ | $xavp(test[0]=> | ||
+ | |||
$xavp(test=> | $xavp(test=> | ||
$xavp(test[0]=> | $xavp(test[0]=> | ||
Line 365: | Line 375: | ||
<code c> | <code c> | ||
- | t = sr.xavp.get(" | + | t = sr.xavp.get(" |
- | for k,t2 in pairs(t) do | + | sr.log(" |
- | for i,v in ipairs(t2) do | + | t = sr.xavp.get(" |
- | | + | |
- | end | + | t = sr.xavp.get(" |
- | end | + | |
+ | t = sr.xavp.get(" | ||
+ | | ||
+ | t = sr.xavp.get(" | ||
+ | sr.log(" | ||
</ | </ | ||
Line 376: | Line 390: | ||
<code c> | <code c> | ||
- | a[1]:3[number] | + | |
- | a[2]: | + | sr.xavp.get(' |
- | a[3]:1[number] | + | sr.xavp.get(' |
- | b[1]:three[string] | + | sr.xavp.get(' |
- | b[2]: | + | sr.xavp.get(' |
- | b[3]: | + | |
</ | </ | ||
===== SR.SL Package ===== | ===== SR.SL Package ===== |