[DGD] Referencing an array of variable depth
Robert Forshaw
iouswuoibev at hotmail.com
Mon Mar 1 19:07:11 CET 2004
>From: Michael McKiel <crashnbrn71 at yahoo.ca>
>Wouldn't a mapping work? If every action can be sub_action'ed then every
>further element of the mapping would be the sub_action of the previous
>action
>and you could indice it based on numbers.
>
>mapping action_queue;
>
>action_queue = ([ ]);
>
>action_queue += ([ 1 : ({ some_array }) ]);
>/* have another action to tack onto so */
>action_queue += ([ 2 : ({ another_arr }) ]);
>/* etc */
>
>yer map_sizeof(action_queue) will return 2.
>So the size of yer map will always be the last sub_action...
>then you can fetch yer map_indices, and/or map_values as needed.
>
>Just ma 2cents, seeing as no reply yet ;)
I must admit though I hadn't considered using a mapping. You had a point
about using an array and keeping the sub-actions at the same level (so they
can be easily referenced), supposedly doing an array for each action in the
queue and all its sub-actions. Doing it that way will make my final
objective harder though, so ideally I still need to be able to nest actions
within action_queues within actions within action_queues...
_________________________________________________________________
Tired of 56k? Get a FREE BT Broadband connection
http://www.msn.co.uk/specials/btbroadband
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list