Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to test if an Array exists

Status
Not open for further replies.

1421

Technical User
Feb 24, 2004
69
Hi,

I am copying data to an array using a condition & in some cases i am not getting any data & the Array is not created. Can I check if an Array exisits?

THank YOu
 

I am copying data to an array using a condition & in some cases i am not getting any data & the Array is not created. Can I check if an Array exisits?

Yes.
Right after COPY TO ARRAY (or SELECT INTO ARRAY), check _TALLY system variables. It will contain the number of lines actually copied. If it is equal to zero, no lines were copied to the array.

Also, you can always check the type of your array with TYPE() function. If TYPE("MyArray") returns "U" (undefined), the array was not created. Otherwise, it should return one of the valid data types (the type of the first element of array).

Personally, I would prefer the _TALLY test.
 
this resolves the problem, it works now fine!

thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top