 |
|
|
|
|
|
|
|
|
|
|
|
|
SVUG Community Forum
|
|
| Author |
Messages |
|
Manuel
Posts:1
 |
| 05/06/2008 2:38 AM |
|
Hi everyone!
As I have tested you can make multidimensional associative arrays. For example: logic Ε:0] mem [integer][integer]
But how do I call the exists() function for such an array? The syntax is: function int exists (input index);
Does anyone have an idea?
|
|
|
|
|
Shalom
Posts:11
 |
| 05/06/2008 2:46 AM |
|
The LRM has this example: The syntax for the exists() method is as follows: function int exists( input index ); where index is an index of the appropriate type for the array in question. The exists() function checks whether an element exists at the specified index within the given array. It returns 1 if the element exists; otherwise, it returns 0. if ( map.exists( "hello" )) map[ "hello" ] += 1; else map[ "hello" ] = 0; |
|
|
|
|
Dave
Posts:17
 |
| 05/06/2008 6:29 PM |
|
| There is really no such thing as a multi-dimensional array; there are single-dimensional arrays whose elements can also be arrays. You will have to call the exists method once for each array dimension. |
|
|
|
|
|
| You are not authorized to post a reply. |
|
|
|
ActiveForums 3.7
|
|
|

|
|
|
|
|
|
|
|
|
|
 |
|