Maybe you could use 2 2 dimensional arrays, might be a little less clunky. 
Then you could do something like:
menutext = arrayNew(2)
menulink = arrayNew(2)

menutext[1][1] = "text"
menulink[1][1] = "link"

menutext[2][1] = "text2"
menulink[2][1] = "link2"

menutext[2][2] = "text2subtext1"
menulink[2][2] = "link2sublink1"

etc.

To check for existence of sub menu you would do "if ArrayLen(menutext[i] GT 
1)" if i was your loop index.

-- Josh





----- Original Message ----- 
From: "Ian Skinner" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Wednesday, May 24, 2006 10:20 AM
Subject: Better way to describe a menu.


> I'm trying to create dynamic menu that can be easily described in a 
> variable.  My first attempt feels very clunky.  Can anybody suggest a 
> cleaner and/or more efficient way to describe a nested menu?
>
> My first Attempt:
> menu = arrayNew(1);
> menu[1] = structNew();
> menu[1].text = "A link";
> menu[1].link = "http://www.google.com";;
>
> menu[2] = structNew();
> menu[2].text = "B link";
> menu[2].link = "http://www.google.com";;
>
>  menu[2].subMenu = arrayNew(1);
>  menu[2].subMenu[1] = structNew();
>  menu[2].subMenu[1].text = "subMenu 1";
>  menu[2].subMenu[1].link = "http://www.google.com";;
>
>
> --------------
> Ian Skinner
> Web Programmer
> BloodSource
> www.BloodSource.org
> Sacramento, CA
>
> ---------
> | 1 |   |
> ---------  Binary Soduko
> |   |   |
> ---------
>
> "C code. C code run. Run code run. Please!"
> - Cynthia Dunning
>
> Confidentiality Notice:  This message including any
> attachments is for the sole use of the intended
> recipient(s) and may contain confidential and privileged
> information. Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the
> intended recipient, please contact the sender and
> delete any copies of this message.
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241326
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to