arrays_20of_20structures_20_28lbb_29
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
arrays_20of_20structures_20_28lbb_29 [2018/03/31 13:19] – external edit 127.0.0.1 | arrays_20of_20structures_20_28lbb_29 [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
//by Richard Russell, December 2014//\\ \\ One of the language extensions provided by [[http:// | //by Richard Russell, December 2014//\\ \\ One of the language extensions provided by [[http:// | ||
+ | <code lb> | ||
STRUCT sname(dims), | STRUCT sname(dims), | ||
+ | </ | ||
Arrays of structures may have any number of dimensions, limited only by available memory. As with ordinary numeric and string arrays the index value runs from 0 to the specified maximum dimension.\\ \\ Accessing an individual member, in order to change or read its value, again uses a syntax very similar to that used for a single (scalar) structure: | Arrays of structures may have any number of dimensions, limited only by available memory. As with ordinary numeric and string arrays the index value runs from 0 to the specified maximum dimension.\\ \\ Accessing an individual member, in order to change or read its value, again uses a syntax very similar to that used for a single (scalar) structure: | ||
+ | <code lb> | ||
sname(index).member.struct = newvalue | sname(index).member.struct = newvalue | ||
PRINT sname(index).member.struct | PRINT sname(index).member.struct | ||
+ | </ | ||
\\ To pass the entire array of structures as a parameter to an API function use the following syntax: | \\ To pass the entire array of structures as a parameter to an API function use the following syntax: | ||
+ | <code lb> | ||
sname() AS struct | sname() AS struct | ||
+ | </ | ||
Note the use of a pair of parentheses with nothing in between.\\ \\ Here are a couple of examples of the use of arrays of structures. Firstly an adaptation of the program by Dennis McKinney at the [[http:// | Note the use of a pair of parentheses with nothing in between.\\ \\ Here are a couple of examples of the use of arrays of structures. Firstly an adaptation of the program by Dennis McKinney at the [[http:// | ||
+ | <code lb> | ||
' | ' | ||
| | ||
Line 44: | Line 51: | ||
[quit] | [quit] | ||
end | end | ||
+ | </ | ||
\\ Secondly, an example of passing an array of structures to an API function: | \\ Secondly, an example of passing an array of structures to an API function: | ||
+ | <code lb> | ||
nomainwin | nomainwin | ||
open " | open " | ||
Line 64: | Line 73: | ||
close #w | close #w | ||
end | end | ||
+ | </ |
arrays_20of_20structures_20_28lbb_29.1522502345.txt.gz · Last modified: 2024/01/05 00:18 (external edit)