Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT-SQL INTO ARRAY returns a NULL value
Message
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00912356
Message ID:
00912367
Views:
17
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform