Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array error? How can it happen?
Message
From
12/01/1999 11:41:00
 
 
To
12/01/1999 11:36:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00174806
Message ID:
00175081
Views:
35
>>>When I run my form I get the following error message -
>>>
>>>'MyArray' is not an array. BUT IT IS AN ARRAY!!
>>>
>>>In the Init for the Form I have
>>>
>>>PUBLIC ARRAY MyArray(7,2)
>>>
>>>Later on in the Init for the Form I open a table to populate the array. Then later on in the Form the Array is going to become the Drop-down List in a Combobox.
>>>
>>>SELECT Mytable
>>>COPY TO ARRAY MyArray
>>>
>>>Any idea what's wrong? Every once in a great while I don't get the error and the array works and the combobox works and I don't change anything. I always CLOSE ALL and CLEAR ALL between tests so that is not the cause.
>>>
>>>Thanks for your help once again.
>>
>>Probably, you try to use this array in Combo.Init event which fires before Form.Init. Anyway, form property-array is much better way.
>
>Ed I am experiencing the same problem, but I am creating an array thru a view
>I put the code in the ini event in my form and then I comes back with the
>error that the arrya is not an array. Now but If I (and this is really
>interesting) change the array name to have only 6 chars, then It works, exe:
>
>sele field1 from table1 into array Myarray (more than 6 chars), I doesn't work
>sele field1 from table1 into array Myaray (6 chars), I will work
>
>Am I assuming this, or Has it happen to you before??
>
>Mark Oliva

I don't know, why you got it. I just see that both things are suspicious because of potential scoping problems (I don't know is it public array?). My preference is not to use arrays as combo.rowsource. Instead, I either use cursor or just fill combo by Add(List)Item.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform