Hi Lembit,

> FOR T=1 TO DCOUNT(R.X<i,j>,@SM)
>     CRT 'In loop ':T
> NEXT
>
> It never goes to CRT if the R.X<i,j> is empty. Does anybody know - is it
> a feature or bug ?

Seems right to me. DCOUNT("",@SM) evaluates to zero hence you end up with
   FOR T = 1 TO 0
which will not execute the loop at all.

As a general point of style/performance, beware that the end point of a FOR
loop is evaluated for every cycle of the loop. Thus, if R.X<i,j> had 1000
elements, you would extract and count them 1000 times. The perfomance will
decrease rapidly as the number of elements goes up. Unless the count could
change during execution of the loop, you should write

 N = DCOUNT(R.X<i,j>,@SM)
 FOR T=1 TO N
>     CRT 'In loop ':T
> NEXT


Martin Phillips
Ladybridge Systems
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB
+44-(0)1604-709200
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to