Difference between revisions of "Linklist.setvalue"

From OpenEUO
Jump to: navigation, search
(Created page with "== Calling Pattern == Call local k = sl.linklist() -- later local r = k.setvalue(a) Arguments a is a number Results r is a number == Example Usage == local k = sl.linkl...")
 
m (See Also)
 
Line 42: Line 42:
 
* [[linklist.removelink]]
 
* [[linklist.removelink]]
 
* [[linklist.returntable]]
 
* [[linklist.returntable]]
* [[linklist.setvalue]]
 
 
* [[linklist.swap]]
 
* [[linklist.swap]]
 
* [[linklist.tail]]
 
* [[linklist.tail]]
 
* [[linklist.value]]
 
* [[linklist.value]]

Latest revision as of 14:33, 18 December 2010

Calling Pattern

Call

local k = sl.linklist()
-- later
local r = k.setvalue(a)

Arguments

a is a number

Results

r is a number

Example Usage

local k = sl.linklist()
local j = k.inserta(0,'one')
local j0 = j
j = k.inserta(j,'two')
j = k.inserta(j,'three')
k.setvalue(j0,'uno')
print(k.value(k.head()))
--> uno 

Description

Calling setvalue replaces the value associated with a valid link pseudo-index a. For all successful calls, setvalue returns a. If the list is empty or a is otherwise an invalid pseudo-index, setvalue returns 0.

See Also