Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

CL: 'nother macro question

 
   Macintosh computer (Home) -> Adventure RSS
Next:  Mirror open?  
Author Message
rhdennis

External


Since: Jun 25, 2003
Posts: 53



(Msg. 1) Posted: Fri Jun 27, 2003 10:49 pm
Post subject: CL: 'nother macro question
Archived from groups: comp>sys>mac>games>adventure (more info?)

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 =)

Thanks!

rhdennis

 >> Stay informed about: CL: 'nother macro question 
Back to top
Login to vote
Nohn

External


Since: Jun 30, 2003
Posts: 4



(Msg. 2) Posted: Mon Jun 30, 2003 11:21 am
Post subject: Re: CL: 'nother macro question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Macro Reference - Many sites reference the caltech/~barrick/macros link, but it doesn't exist. Anyone have that saved, cached, etc? Thanks, rhdennis

CL: help me write macro - I wrote a macro to repeat polish sword of soul until it see your face. But the macro only repeat polish and dont end. Please help. { set @interruptkey "true" label one "/use /polish\r" set wrd1 @env.textLog if @env.textLog == "Y...

CL: Undocumented Macro feature - I just stumbled on another interesting undocumented feature similar in nature to one Phineas wrote about some time ago. His involved setting goto points via a variable. Turns out this is a VERY powerful feature and I've used this extensively in my..

CL: chain question - I wonder how can I make sure I use the same chain until it breaks. Not to give to other accidentially or use the new chain instead if I make one. Thanks

CL: Ledger question - if a ledger is lost how can you obtain another? i have lost my language ledger and the trainer doesn't offer to purchase another. Is this right?
   Macintosh computer (Home) -> Adventure All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]