Difference between revisions of "var.makeNumericList"

From Inspired-Lua Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ var.'''makeNumericList''' is a function that is part of the Var library. Creates a list in the symbol table with the given ''name''. <b...")
 
 
(One intermediate revision by the same user not shown)
Line 22: Line 22:
  
 
== Example  ==
 
== Example  ==
 +
<syntaxhighlight>var.makeNumericList("myList") -- myList will get created as a list variable</syntaxhighlight>
 +
 +
== Good to know ==
 +
This function cannot be used to create a numeric matrix. Routines [[var.recallAt]] and [[var.storeAt]] will work with matrices but only if they are created by some other means ([[var.store]]) :
 +
 
<syntaxhighlight>var.store("mat", {{1,2}, {3,4}}) -- create matrix mat in the symbol table
 
<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
 
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>
 
val = var.recallAt("mat", 1, 1) -- grab it back in lua</syntaxhighlight>
 
 
== Good to know ==
 
This function cannot be used to create a numeric matrix. Routines [[var.recallAt]] and [[var.storeAt]] will work with matrices but only if they are created by some other means.
 
  
 
== See also  ==
 
== See also  ==

Latest revision as of 13:18, 7 June 2012

var.makeNumericList is a function that is part of the Var library.


Creates a list in the symbol table with the given name.
The list is optimized to hold numeric values.Routines var.storeAt and var.recallAt operate much more efficiently on lists that are created with this function.


This has been introduced in TI-Nspire OS 3.2 (Changes).


Syntax

var.makeNumericList(name)

Parameter Type Description
name
string name of the variable to create

Example

var.makeNumericList("myList") -- myList will get created as a list variable

Good to know

This function cannot be used to create a numeric matrix. Routines var.recallAt and var.storeAt will work with matrices but only if they are created by some other means (var.store) :

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

See also