>i have a menu option with two lines of code
>
>? wexist('gform') &&returns .t.
>gform.visible = .f. &&returns error "object gform is not found"
>
>not sure why that second line does not work if the form exists. how do i manipulate the form properties from within the menu? when i ran the form i am using "do form gform name gform"
>
>thanks,
>
>n.
Nancy,
2 parts.
1) wexist('gform') is not a verifier for gform is there as an object.
? wexist('gform') &&returns .t.
show window gform
2) If you use do form with name clause then be sure the 'name' is in scope later when it's called. It's like any other variable and has the same scoping rules.
public gForm
do form name gForm
would make it work BUT public variables are not suggested. Create a single custom object on your app on entry and save things that should persist there.
When you use that also change your code to:
if type('gForm.Visible')='L'
gForm.Visible = .f.
endif
PS: You might need extra checks if it's a form.
Cetin