Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I Store an Array in a Custom Object?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00137989
Message ID:
00137995
Views:
16
>Greetings!
>
>I have a custom object that I use to store variables, which I think is so much better than having a lot of public variables.
>
>Is it possible to store an array in a custom object? After adding the property in the object, any attempt to dimension it results in a " is not an array" error message. The variable is initialized as logical by default, and I do not know how to set its default to an array. It SEEMS that the only way to have a globally-accessible array is to just make it PUBLIC. Is this true? Or, is it possible to programatically add a property(variable) to a custom object, initializing it as an array?
>
>Thank you!
>
>Michael Reynolds

Mike,

When you create the property you have to tell VFP that it's an array:

DEFINE CLASS mike AS Custom
DIMENSION MyArray[1]
MyProperty = 0

ENDDEFINE

In the form or class designer, select the New Property option and specify at least one dimension after the name of the property:

MyArray[1]

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform