On 02/11/2013 12:14 AM, Peter Cheney wrote:
Hi Everyone,
Does a DCOUNT get evaluated again for each iteration of a loop?
Or is UniVerse these days intelligent enough to keep track of what's going on?
e.g.
for i = 1 to dcount(array,@fm)
*commands here
next i
versus
totalattributes = dcount(array,@fm)
for i = 1 to totalattributes
*commands here
next i
Apart from readability and perhaps easier debugging is there an actual internal
difference?
I know it was an issue on older pick releases but I cannot remember if it ever
affected UV?
Not sure about universe, but unidata defintely checks the DCOUNT for
each iteration. This produces 4 (not 2):
CT=0
X=45:@VM:58
FOR I=1 TO DCOUNT(X,@VM)
CT+=1
IF I<=2 THEN
X<1,-1> = 99
END
NEXT I
CRT CT
--
Jeffrey Butera, PhD
Associate Director for Application and Web Services
Information Technology
Hampshire College
413-559-5556
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users