Changes

Jump to navigation Jump to search

var.recallAt

1,203 bytes added, 13:56, 7 June 2012
Created page with "var.'''recallAt''' is a function that is part of the Var library.<br /> Recalls a value from a cell of a list or matrix in the symbol table. This function is ..."
var.'''recallAt''' is a function that is part of the [[:Category:var|Var]] library.<br />

Recalls a value from a cell of a list or matrix in the symbol table.

This function is optimized to work with numeric values and normally returns a number. If the value of the recalled cell is not numeric, this function returns nil and an error message string.


{{Since|3.2}}

== Syntax ==
var.'''recallAt'''(name, column [,row])

{| class="wikitable"
|-
! Parameter !! Type !! Description
|-
| <u><center>name</center></u> || string || Description of arg1
|-
| <u><center>column</center></u> || number || Description of arg2
|-
| <u><center>row</center></u> || number || Description of arg3
|-
|}

== Example ==

<syntaxhighlight>var.store("mat", {{1,2}, {3,4}}) -- create matrix mat in the symbol table
var.storeAt("mat", 13.3, 1, 1) -- puts the number 13.1 into the field 1,1 of the matrix
val = var.recallAt("mat", 1, 1) -- grab it back in lua</syntaxhighlight>

== Good to know ==
Routines [[var.recallAt]] and [[var.storeAt]] will work with matrices but only if they are created by some other means ([[var.store]]) :

== See also ==
*[[var.storeAt]]
*[[var.makeNumericList]]

<br />

[[Category:var]]

Navigation menu