Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine if Array exists
Message
De
28/02/2003 20:58:24
 
 
À
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:
00759801
Vues:
25
You can check for the value of _tally after the select. If it is 0, the query returned no rows and the array was not created.
if _tally > 0
  *!* do your processing
endif
Alternately you can use type() function
if type("yourarray[1]") = "U"
  *!* array does not exist
else
  *!* do your processing
endif
Or you can use both to be absolutely sure that the array exists
if _tally > 0 and type("yourarray[1]") != "U"
   *!* do your processing 
endif
HTH

>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,
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform