Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form Always Returns True
Message
From
21/05/2001 11:25:23
 
 
To
21/05/2001 11:15:04
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00509475
Message ID:
00509489
Views:
16
This message has been marked as the solution to the initial question of the thread.
Hi!

When you use 'DO FORM ... TO lOk', the result of the form is put into the variable. The result is the value returned from the Unload event fo the form. If you have no code there or nothing returned, the default is a logical .T. If you want that code function corrcet, do not use 'To' in the 'Do Form'. Or put the result into the property of the form inside of the form, and return the value of that property in the Unload event of the form - than you can use 'To' as you did.

HTH.

>The following call to a modal form always returns true regardless of the what is being set in the form. The variable lOk is public and is only used as shown below. I know setting lOk in the Valid is superfulous, but the return by iteself wasn't working and I was grasping...
>
>DO FORM OkNo WITH 'Help does not exist for this. Do you wish to add it?' TO lOk
>
>(In Valid method of CommandGroup in OkNo form):
>
>IF This.Value = 1
>lOk = .T.
>Return .T.
>ELSE
>lOk = .F.
>Return .F.
>ENDIF
>
>I've stepped through the code and the ELSE condition is being run and lOk evaluates to .F. during the Valid. In fact, the only time lOk evaluates to .T. is on the line following the DO FORM call after returning from the OkNo form. I thought it might be variable scoping, but I haven't been able to find anywhere that lOk is being set to anything other than False. Any thoughts? Thanks!
>
>Regards, Renoir
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform