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.comICQ #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.