Entry
TSE: Datastructure: Array: Create: How to implement an array in TSE?
Oct 4th, 2004 10:35
Knud van Eeden,
----------------------------------------------------------------------
--- Knud van Eeden --- 04 October 2004 - 05:43 pm --------------------
TSE: Datastructure: Array: Create: How to implement an array in TSE?
---
Method: Global variable via concatenating the array index number
You simulate an array in TSE by building a global variable string via
concatenation.
---
1. First its variable name made up of one or more alphanumeric
characters.
2. Followed by a number (e.g. an integer converted to a string).
e.g.
"array" + "1", or thus "array1",
"array" + "2", or thus "array2",
..., "array" + "65535", or
thus "array65535" and set and get its values).
---
You set its value by using a global SetGlobalStr
e.g.
I = 25
SetGlobalStr( "array" + Str( I ), "test" )
// this sets array25 to "test"
---
You get its value by using a global GetGlobalStr
e.g.
Message( GetGlobalStr( "array" + Str( I ) ) )
// this shows the value of array25, which is currently "test"
---
---
--- cut here: begin --------------------------------------------------
PROC Main()
INTEGER I = 25
// this sets array25 to "test"
SetGlobalStr( "array" + Str( I ), "test" )
// this gets the value of array25, which is currently "test"
Message( GetGlobalStr( "array" + Str( I ) ) )
END
--- cut here: end ----------------------------------------------------
---
---
Internet: see also:
---
TSE: Drive: Link: Overview: Can you give an overview of links about a
drive?
http://www.faqts.com/knowledge_base/view.phtml/aid/31763/fid/896
----------------------------------------------------------------------