Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you test to see if an array exist
Message
From
03/06/1999 11:39:48
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00225707
Message ID:
00226004
Views:
27
>Thanks for the tip (especially on command 'release'), however, now I a get an error that says:
>
>Variable 'A__ARRAY1' is not found
>
>here is the code I am trying to run.
>
>* for fms view on core table
>dimension a__array(1,8)
>
>select O_ord_pay.op_main_key, O_ord_pay.op_fmspaidmo, ;
> O_ord_pay.op_po_no, O_ord_pay.op_amt, O_ord_pay.op_vendor,;
> O_ord_pay.op_flag_7, O_ord_pay.op_uniqueid, O_ord_pay.op_date_paid;
> from dbbudget!o_ord_pay;
> where O_ord_pay.op_flag_1 = 3;
> AND O_ord_pay.op_flag_7 <= 98;
> AND O_ord_pay.op_main_key = int(val(.cbomk.value));
> OR (O_ord_pay.op_flag_1 BETWEEN 6 AND 10;
> AND O_ord_pay.op_flag_7 <= 98;
> AND O_ord_pay.op_main_key = int(val(.cbomk.value)));
> order by O_ord_pay.op_date_paid ;
> into array a__array1
>
>if type(a__array1) <> 'u'

This is the problem. TYPE() takes a character expression as an argument, and returns an upper case value. Try:

IF TYPE('a_array[1]') # 'U'

> append from array a__array1
> release a__array1
>else
> release a__array1
>endif
>
>I have dimensioned my array before retrieving values into the array. This error occurs when I don't have anything going into an array. I basically just want to continue on if my array has no values.
>
>
>thanks
>nick patel
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform