This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
embeddedapi:devel:lua [2013/09/16 22:14] linuxmaniac [sr.xavp.get_keys] |
embeddedapi:devel:lua [2017/06/23 11:08] sdamm |
||
---|---|---|---|
Line 60: | Line 60: | ||
* dbg | * dbg | ||
* info | * info | ||
+ | * notice | ||
* warn | * warn | ||
* err | * err | ||
Line 347: | Line 348: | ||
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) | 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, 0) | + | sr.xavp.get(xavp_name, |
</ | </ | ||
Line 357: | Line 360: | ||
<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 366: | Line 376: | ||
<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(" |
- | for k,v in pairs(t) do | + | t = sr.xavp.get(" |
- | | + | |
- | end | + | |
</ | </ | ||
Line 382: | Line 391: | ||
<code c> | <code c> | ||
- | a[1]:3[number] | + | |
- | a[2]:2[number] | + | sr.xavp.get(' |
- | a[3]: | + | sr.xavp.get(' |
- | b[1]:three[string] | + | sr.xavp.get(' |
- | b[2]: | + | |
- | b[3]:one[string] | + | |
- | + | ||
- | a:3[number] | + | |
- | b:three[string] | + | |
</ | </ | ||
===== SR.SL Package ===== | ===== SR.SL Package ===== |