Question (more or less) about arrays

Mark Smith mark at maseurope.net
Tue Apr 3 04:58:47 EDT 2007


JB, there are various requests in place at the qa center for  
enhancements to both the implementation and documentation of arrays  
in Rev (type 'array' into the search field, and you'll see them).

As it stands, Revs arrays are just different from normal variables,  
and what you've found is the normal behaviour, so maybe you might  
want to vote for a documentation update at least.

Best,

Mark

On 3 Apr 2007, at 10:47, jbv wrote:

> Hi all,
>
> Please test this little script :
>
> on mouseUp
>   put 0 into var[1]
>   put 0 into var[2]
>   if var = empty then
>     put 0
>   else
>     put 1
>   end if
> end mouseUp
>
> In order to check if array "var" contains any element,
> the following test must be used instead :
>     if the keys of var = empty then
>
> I was just wondering if you guys would find this behaviour
> "normal" ? I've just lost more than 1 hour trying to debug a
> script in which I need to test the content of different variables
> (some arrays, some made of lines of items), and thought
> (naively ?) that any array would be considered as "not empty"
> as soon as it contains at least 1 key...
> Obviously I was wrong, as it seems that "empty" applies only
> to variables containing straight text...
>
> I don't have any recent Rev doc at hand, only an old MC version,
> and the doc doesn't say much on this topic... May be Rev docs
> are more explicit...
>
> Best,
> JB
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list