Difference between revisions of "var.list"

From Inspired-Lua Wiki
Jump to navigation Jump to search
(Created page with "var.'''list''' is a function that is part of the Var Library. <br> The function returns a table with all the names of variables currently defined in the document.<br> ...")
 
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
 
== Example  ==
 
== Example  ==
  
<source lang="lua">--Clipboard test
+
<source lang="lua">
 
 
 
function on.paint(gc)
 
function on.paint(gc)
 
variables = var.list()
 
variables = var.list()

Latest revision as of 13:08, 1 June 2011

var.list is a function that is part of the Var Library.


The function returns a table with all the names of variables currently defined in the document.

Syntax

var.list()
returns a table with variable with variable names.

Example

function on.paint(gc)
	variables = var.list()
	for i=1, table.getn(variables) do
		gc:drawString(variables[i], 10, 10*i-10, "top")
	end
end

This code retrieves the variable names and then prints them on the screen.

See also