testing whether the value of a variable is an array

Jeanne A. E. DeVoto jeanne at runrev.com
Thu Apr 11 13:36:55 EDT 2002


At 8:58 AM -0700 4/10/2002, Ben Rubinstein wrote:
>Is there a clean way to test this?  Currently I'm using a pragmatic test:
>
>    function isArray @v
>      if v <> empty then return false
>      return (the keys of v <> empty)
>    end isArray
>
>Is this reasonable?  Is there a more 'official' way?

That's the way I'd do it. Testing the keys is definitive.

--
Jeanne A. E. DeVoto ~ jeanne at runrev.com
Runtime Revolution Limited - The Solution for Software Development
http://www.runrev.com/





More information about the use-livecode mailing list