Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refering to objects
Message
From
20/12/1999 17:17:34
 
 
To
20/12/1999 16:50:44
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00306427
Message ID:
00306460
Views:
28
>Hi David,
>
>>I want to refer to a value of a control in a form from a program by using the following code.
>>resphead.comp_code.value
>>resphead is the form file name and comp_code is the name of the control on the form. If the form is modal everything works fine. But if the form is modeless Foxpro can't evaluate it. Why?
>
>What is your DO FORM? Try using the NAME and LINKED clause of DO FORM to create an object reference for you:
>
>DO FORM Forms\RespHead NAME resphead LINKED
>
>And make sure the variable doesn't go out of scope.
>

Neither the NAME clause, NOR the LINKED clause should be necessary here. VFP creates a variable with the name of the form when you issue your DO FORM (unless there is another instance of the form running, in which case VFP creates some other variable).

The LINKED clause will do nothing but cause the form to release when the variable created is released.

David's problem more likely lies in where/ when he is trying to reference the form by name.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform