Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT-SQL INTO ARRAY returns a NULL value
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Titre:
SELECT-SQL INTO ARRAY returns a NULL value
Divers
Thread ID:
00912356
Message ID:
00912356
Vues:
61
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform