Question (more or less) about arrays

Viktoras Didziulis viktoras at ekoinf.net
Tue Apr 3 10:42:35 EDT 2007


in Perl it would return a scalar context of variable in this case it is size
of an array (e.g. number of elements) e.g. $var_size = @var 
thence one can write 
for ($i = 0; $i < @var; $i++) 
{ 
#prints all elements of array @var to STDOUT 
print $var($i); 
} 
 
Viktoras 
 
-------Original Message------- 
 
From: Richard Gaskin 
Date: 03/04/2007 17:11:45 
To: How to use Revolution 
Subject: Re: Question (more or less) about arrays 
 
Mark Smith wrote: 
 
> On 3 Apr 2007, at 10:47, jbv wrote: 
 
>> 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" ? 
... 
> 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. 
 
But here's the tough question: if "var" contains an array, then no 
valid data can be returned by accessing it without the name of one of 
its keys. So what should "var" return when checked directly? 
 
-- 
Richard Gaskin 
Fourth World Media Corporation 
___________________________________________________________ 
Ambassador at FourthWorld.com http://www.FourthWorld.com 
 
_______________________________________________ 
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