>I have an application class method. Here is the code.
>
>LPARAMETERS tcCategoryCursor
>
>SELECT SUM( itemcost ) AS TOTALCOST ;
>FROM ( tcCategoryCursor ) ;
>INTO ARRAY laCategoryCost
>
>RETURN IIF( _TALLY > 0, laCategoryCost[ 1 ], 0 )
>
>The value returned from thsi method is assigned to a value property of a textbox.
>
>In the case where tcCategoryCursor does not have any rows, I would expect _TALLY to be 0 and the method return 0 (i.e. the behavior I see in VFP 6 and VFP 8).
>
>However, in VFP9, _TALLY is set to 1 and a single-element array is created with a value of .NULL.
>
>Is this the intended behavior in VFP9? The documentation does state that the array is created if is doesn't exist or is re-dimensioned as needed, but doesn't mention setting its value to .NULL. if the underlying cursor/table does not have any rows.
>
>Thank you,
>
John,
Try adding
DIMENSION laCategoryCost[1]
laCategoryCost = 0
priot to your SQL Select statement to see if the behavior is as you would expect.
George
Ubi caritas et amor, deus ibi est