rhdennis <rhdennis DeleteThis @guess.sbcglobal.net> wrote in message news:<rhdennis-576B62.14491127062003 DeleteThis @newssvr30-ext.news.prodigy.com>...
> Has anyone successfully used two dimension arrays in the CL macro
> language? If so, what structure? Is there a 'nul' variable for instance?
> How do you control setting the various cells? Can multiple cells be
> tested at the same time?
>
> set(global) My_Array[][1][][][] "test" ?
>
> if My_Array[1][1][][][] == ??
>
>
> Just curious if anyone else has played with this stucture before I jump
> in and re-invent the wheel so to speak =)
This is a post from Phineas, from Oct. 10, 2000. It might help a
little, although it doesn't address your question about NULL.
Nohn
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Would y'all believe that Clan Lord macros already support arrays?
It's an
undocumented feature!
The syntax:
set <variable_name>[<number>] <value>
or
setglobal <variable_name>[<number>] <value>
Example:
"array"
{
set name_list[1] "Aki"
set name_list[2] "Haze"
set name_list[3] "Sleipnir"
//
set counter 1
label loop_top
name_list[counter] "\r"
message "This is name array " counter "."
pause 2
set counter + 1
if counter != 4
goto loop_top
end if
}
I also understand that two dimensional arrays will work as well as
nested arrays:
set <variable_name>[<number_1>][<number_2>]
set <variable_name>[<number_1>[<number_2>]]
should both work (I haven't found a use for two dimensional arrays, so
I
haven't played with them at all). I have made several macros that use
arrays,
and they rock.
One word of advice: when initializing arrays, use global variables
with global
arrays, and local variables with local arrays. Don't mix them up, or
your
array will not initialize properly.
setglobal <global_variable>[<global_number>] <value>
is good.
setglobal <global_variable>[<local_number>] <value>
is bad, and will result in the array not being set correctly.
Yes, this is the voice of experience speaking. <g>
--Phineas<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: CL: 'nother macro question