Trey,
Thanks for the answer. I was using this case as an example. The IsOkay() method is being bound to many different controls on the form. Any thoughts? I don't really want to write and maintain a check like the one you described in several places. Thanks again,
jfh
>>Hello,
>>Lets say I have a piece of code that returns .T. or .F. depending on if it is okay to close a form or not. Now, the exit button on the form just calls the forms release method. So, I bind the click of the button to the IsOkToExit method on the form. The method, in this case, returns .F., how to I halt the execution of the button's code? Thanks,
>>
>>jfh
>
>I wouldn't bind the event in this case.
>
>You could wrap the call, e.g.
>
>
>If thisform.IsOkToExit()
> thisform.Release()
>EndIf
>
>My preferred way of doing this is to put the IsOkToExit call in the form's QueryUnload(), then, even if the user clicks the 'x' to close the form it still halts the release, e.g.
>
>just call the release in the button click
>
>thisform.Release()
>and let the QueryUnload() handle the exit approval
>
>Return thisform.IsOkToExit()
>
>
>If the QueryUnload() returns .F., the form release is halted.