Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can an array available in all procedures like a variable
Message
From
26/04/2000 21:55:37
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00363356
Message ID:
00363942
Views:
16
>I create an array in my init procedure
>
>dimension a__gen10(1,2)
>

Instead, make it a property, and use it as follows:

In your Init:

this.AddProperty('a_gen10[1,1]')
DIMENSION this.a_gen10(1,2)

You can use thisform or thisformset if they're more appropriate. The member array is scoped to the life of the object. You can also define a member property ahead of time visually using the same type of notation in the Add New Property dialog.

>as soon as I leave init procedure and go grids interactivechange() procedure to populate the grid the array definition disappears.
>Is there a way to make array through all the procedure for a form like a variable? I am trying to populate the array in grid by increasing array size and inserting values as follows
>
>*.grid.column1.text1.interactivechange()
>with thisform
>if .first_sw = .f.
> .first_sw = .t.
> .v = .v + 1
> a__gen10(.v,1) = .g1.c1.t1.value
> a__gen10(.v,2) = .g1.c6.t6.value
>else
> dimension a__gen10(alen(a__gen10, 1) + 1, alen(a__gen10, 2)) .v = .v + 1
> a__gen10(.v,1) = .g1.c1.t1.value
> a__gen10(.v,2) = .g1.c1.t1.value
>endif
>endwith
>
>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