Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine if Array exists
Message
From
28/02/2003 20:58:24
 
 
To
28/02/2003 17:43:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00759747
Message ID:
00759801
Views:
18
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,
Previous
Reply
Map
View

Click here to load this message in the networking platform