User Tools

Site Tools


embeddedapi:devel:lua

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
embeddedapi:devel:lua [2011/12/28 11:35]
miconda [sr.xhttp.reply]
embeddedapi:devel:lua [2013/09/16 22:14]
linuxmaniac [sr.xavp.get_keys]
Line 306: Line 306:
 </code> </code>
  
 +===== SR.XAVP =====
 +
 +xavp management functions.
 +
 +==== sr.xavp.get_keys ====
 +
 +returns an array table with the key names of the xavp variable.
 +
 +Prototype
 +
 +<code c>
 +t = sr.xavp.get_keys("xavp_name", 0)
 +</code>
 +
 +Example
 +
 +<code c>
 +$xavp(test=>one) = 1;
 +$xavp(test[0]=>two) = "two";
 +$xavp(test[0]=>three) = 3;
 +</code>
 +
 +<code c>
 +t = sr.xavp.get_keys("test", 0)
 +for k,v in pairs(t) do
 +  sr.log("info", string.format("%d:%s\n", k, v))
 +end
 +</code>
 +
 +Result
 +
 +<code c>
 +1:three
 +2:two
 +3:one
 +</code>
 +
 +==== sr.xavp.get ====
 +
 +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
 +
 +<code c>
 +t = sr.xavp.get("xavp_name", 1, 0)
 +</code>
 +
 +Example
 +
 +<code c>
 +$xavp(test=>a) = 1;
 +$xavp(test[0]=>a) = 2;
 +$xavp(test[0]=>a) = 3;
 +$xavp(test[0]=>b) = "one";
 +$xavp(test[0]=>b) = "two";
 +$xavp(test[0]=>b) = "three";
 +</code>
 +
 +<code c>
 +t = sr.xavp.get("test", 0, 0)
 +for k,t2 in pairs(t) do
 + for i,v in ipairs(t2) do
 +   sr.log("info", string.format("%s[%d]:%s[%s]\n", k, i, tostring(v), type(v)))
 + end
 +end
 +
 +t = sr.xavp.get("test", 0, 1)
 +for k,v in pairs(t) do
 + sr.log("info", string.format("%s:%s[%s]\n", k, v, tostring(v), type(v)))
 +end
 +</code>
 +
 +Result
 +
 +<code c>
 +a[1]:3[number]
 +a[2]:2[number]
 +a[3]:1[number]
 +b[1]:three[string]
 +b[2]:two[string]
 +b[3]:one[string]
 +
 +a:3[number]
 +b:three[string]
 +</code>
 ===== SR.SL Package ===== ===== SR.SL Package =====
  
Line 483: Line 569:
 </code> </code>
  
 +==== sr.sqlops.xquery ====
 +
 +Execute SQL query and store in XAVP.
 +
 +Prototype
 +
 +<code c>
 +sr.sqlops.xquery("connection", "query", "xavp")
 +</code>
  
 ===== SR.RR Package ===== ===== SR.RR Package =====
Line 621: Line 716:
  
  
-===== SR.dispatcher Package =====+===== SR.DISPATCHER Package =====
  
 ==== sr.dispatcher.select ==== ==== sr.dispatcher.select ====
Line 726: Line 821:
  
 ==== sr.uac.replace_from ==== ==== sr.uac.replace_from ====
 +
 +===== SR.TMX Package =====
 +
 +==== sr.tmx.t_suspend ====
 +
 +===== SR.MQUEUE Package =====
 +
 +==== sr.mq.add ====
  
embeddedapi/devel/lua.txt ยท Last modified: 2017/06/23 11:31 by sdamm