General information
Category:
Visual FoxPro Beta
Title:
SELECT-SQL INTO ARRAY returns a NULL value
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only