Changes

Jump to navigation Jump to search

var.recallstr

926 bytes added, 12:23, 1 June 2011
Created page with "var.'''recallstr''' is a function that is part of the Var Library. <br> The function returns a the content of a math variable in the current document as a string. If it ..."
var.'''recallstr'''&nbsp;is a function that is part of the Var Library.

<br>

The function returns a the content of a math variable in the current document as a string. If it cannot be converted to a string, it returns nil and an error message.<br>

== Syntax ==

var.'''recallstr(varname)'''<br> returns the content of the variable varname (must be a string).

== Example ==

<source lang="lua">
function on.paint(gc)
variable = var.recall("sol") --assuming that sol exists
gc:drawString("The diameter of the sun is " .. variable .. " KM", 10, 10, "top")

--the difference with the other script in the recall page is that you don't need to use tostring for numbers
end
</source>

This code retrieves the content of the variable sol (number), and prints it on the screen.

== See also ==

*[[var.list]]<br>
*[[var.recall]]<br>
*[[var.store]]<br>
*[[var.monitor]]<br>
*[[var.unmonitor]]<br>

[[Category:var]]
68

edits

Navigation menu