Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing an array to a form
Message
From
30/06/1999 02:10:49
 
 
To
29/06/1999 12:38:58
Bob Lucas
The WordWare Agency
Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00235291
Message ID:
00235709
Views:
23
Thanks, Bob

The DO FORM xxx WITH ox was throwing me. I was reading too much into the syntax I think. If I had just passed the damn array "as is" without worrying about an explicit "@" there would be no problem. Thanks again!

>
>I use a real simple custom class that has one property, an array. I use this mostly for passing parameters to forms. When I create the class, I pass one parameter which is the number of dimensions for the array. I can then pass the object around (and they array with it!) without having to worrry of handling arrays.
>
>ox = createobject("FormParms", 5)
>ox.acdata[1] = 'Parameter 1'
>...etc.
>
>*-- usually a modal form getting input
>DO FORM GetInput WITH ox
>
>
>DEFINE CLASS FormParms AS CUSTOM
>
> *-- Custom properties
> DIMENSION acdata(1)
>
> PROCEDURE INIT
> LPARAMETER ncnt
>
> IF TYPE("ncnt") != "N"
> RETURN
> ENDIF
>
> DIMENSION this.acdata[ncnt]
> RETURN
>
>ENDDEFINE
>
>
>
>
>>Hi gang!
>>
>>OK...have a situation that I could use some "been there, done that" advice on. I have a selection form and I'd like to store the selected values to an array. I'd like to create the array in the calling method and pass it to the form. I've tried:
>>
>>PUBLIC ARRAY aSelected[1]
>>DO FORM frmSelector WITH @aSelected
>>
>>But it bombs. Doesn't like the Byref "@" sign. And I don't like the idea of declaring public memvars to begin with.
>>
>>Any suggestions on an alternative architecture? I have it working with PUBLIC ARRAY aSelected[1] and then hard-wiring the reference to aSelected in frmSelector but I don't like to hard-wire memvar references.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform