Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing an array to a form saved as a class
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00074112
Message ID:
00090100
Views:
53
>>Something fishy is going on in what should be a simple bit of parameter passing. I have some code that looks like this:
>>*****************************************
>>DIMENSION laStats
>>ACOPY(this.aStats,laStats,1,-1)
>>oForm = CreateObject('frmStats',@laStats)
>>*****************************************
>>
>>And in the init of the form that I am calling I have:
>>
>>*****************************************
>>PROCEDURE INIT
>>LPARAMETERS taStats
>>
>>this.txtStat1.Value = taStats[1]
>>this.txtStats2.Value = taStats[2]
>>
>>ENDPROC
>>*****************************************
>>
>>Whenver taStats is being accessed as an array I get the "tastats.prg" not found because taStats isn't an array. Shouldn't passing by reference here do the trick?
>
>by reference has nothing to do this. use the external command as in:
>
>external array taStats
>
>vfp thinks taStats is a program unless you explicitly say it is an external >array. you should find that your form runs fine even with this error, but >every compile will stop w/ this message.

I tried using the external command without luck. The problem is although I am passing the array by reference, when I look at my local variables in the init of the form the parameter taStats is a numeric and not an array. If I create a form as the following: oForm = CreateObject(@laArray) and in the init of the form I have: LPARAMETERS taArray. So, taArray should be an array. Hmm...actually, I just realized I am using a DOFORM function to instansiate and show the object, maybe there is something going on there. Let me check that out.

Michael G. Emmons
memmons@nc.rr.com
Previous
Reply
Map
View

Click here to load this message in the networking platform