Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine if Array exists
Message
De
28/02/2003 17:49:37
 
 
À
28/02/2003 17:43:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00759747
Message ID:
00759753
Vues:
19
This message has been marked as the solution to the initial question of the thread.
>Hi,
>
>I created an array with a SELECT-SQL statement. I know if the SQL statement does not return any records the array doesn't get created. I have some code I need to process only if the array is created. How can I check for this? Is there a command for arrays similar to SELECT() to determine if the array is occupying a work area?
>
>Thanks,

Check the value of _TALLY. If it's 0, there were no records returned to the array.

Another technique I use is to initialize the array to a know value before the select:
DIMENSION aTest[1]
aTest = "None"
SELECT id FROM table WHERE condition INTO ARRAY aTest
IF aTest[1]="None"
  * nothing selected
ELSE
  * process array here
ENDIF
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform