Difference between revisions of "Keystr"

From OpenEUO
Jump to: navigation, search
m (Calling Convention)
m (Usage Example)
Line 12: Line 12:
 
  print(r)
 
  print(r)
  
  --> 'table keys = {'
+
  --> table keys = {
  --> 'argval,'
+
  --> argval,
  --> 'null,'
+
  --> null,
  --> 'clrerrors,'
+
  --> clrerrors,
  --> 'probe,'
+
  --> probe,
  --> 'convert,'
+
  --> convert,
  --> 'geterror,'
+
  --> geterror,
  --> 'spin,'
+
  --> spin,
  --> 'luo,'
+
  --> luo,
  --> 'case,'
+
  --> case,
  --> 'ERR,'
+
  --> ERR,
  --> 'slversion,'
+
  --> slversion,
  --> 'macro,'
+
  --> macro,
  --> 'keys,'
+
  --> keys,
  --> 'str,'
+
  --> str,
  --> 'file,'
+
  --> file,
  --> 'keystr,'
+
  --> keystr,
  --> 'slverbosity,'
+
  --> slverbosity,
  --> 'non,'
+
  --> non,
  --> 'testdummy,'
+
  --> testdummy,
  --> 'target,'
+
  --> target,
  --> 'slredirect,'
+
  --> slredirect,
  --> 'iterator,'
+
  --> iterator,
  --> 'try,'
+
  --> try,
  --> 'journal,'
+
  --> journal,
  --> 'keyvalstr,'
+
  --> keyvalstr,
  --> 'slimport,'
+
  --> slimport,
  --> '}'
+
  --> }
  
 
== Description ==
 
== Description ==

Revision as of 16:44, 2 November 2010

Calling Pattern

Call

local r = sl.keystr(arg)

Args

arg is a table

Results

r is a string

Usage Example

local r = sl.keys(sl)
print(r)
--> table keys = {
--> argval,
--> null,
--> clrerrors,
--> probe,
--> convert,
--> geterror,
--> spin,
--> luo,
--> case,
--> ERR,
--> slversion,
--> macro,
--> keys,
--> str,
--> file,
--> keystr,
--> slverbosity,
--> non,
--> testdummy,
--> target,
--> slredirect,
--> iterator,
--> try,
--> journal,
--> keyvalstr,
--> slimport,
--> }

Description

The helper function keystr returns human readable string representation of the keys found in its sole argument. The keys are converted to strings before concatenation into the resultant string. If the sole argument is not a table, then the string 'not a table' is returned.

See Also