Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form reference in run-time
Message
 
To
05/11/1998 20:29:53
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00155075
Message ID:
00155081
Views:
22
Sergey,
The NAME option in the DO FORM command usually does the trick. You have to be careful to keep the name, MyForm, in the same scope that you reference it - it's actually an object reference, just like doing MyForm = CREATE('Form'). For instance, from the command line you create a blank form:
MODI FORM test

...then activate it:
DO FORM test NAME MyForm

...you can now enter in the command window:
test.caption = "HELLO"

... the caption will change. You can make sure the variable MyForm is scoped to any code by placing:
PUBLIC MyForm

...right before the DO FORM... command. (that's not the best way, but it works...)

HTH
Mark

>Question about form reference in run-time. I have
>a file FORM1.SCX with a form,named MYFORM. When I try
>to manipulate with a form at run-time, such as -
>? myform.caption
>or
>? _screen.myform.caption
>I got a message,that such member (MYFORM) isn't found.
>I've tried DO FORM form1 NAME myform , but the result
>is the same :( What's wrong ?
"It hit an iceberg and it sank. Get over it."
Robert Ballard, dicoverer of the Titanic wreckage.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform