David,
This was how I did it. Your comments please.
LPARAMETERS nError, cMethod, nLine
IF "OpenTables" $ cMethod
ThisForm.OpenFileError = .T.
ENDIF
IF ThisForm.OpenFileError
MESSAGEBOX( "Error opening necessary data files." )
RETURN .F.
ENDIF
>Dennis,
>
>That's not the way it works, form level properties are set based off the values of the class and then the overridden values of the form are applied to the properties and the DE starts opening tables, then form objects construct. I just tried this in VFP6, created a baseclass form, created a custom property lDEError and put code in two methods:
>
>
>* form.Load()
>if ( this.lDEError )
> messagebox( "can't run" )
> return .f.
>endif
>
>* DE.BeforeOpenTables()
>thisform.lDEError = ( gcErrorTest == "bad" )
>
>
>I used the gcErrorTest memvar only to be able to easily test this. and it works as expected. Set gcErrorTest = "" in the command window and run the form it appears. Set gcErrorTest = "bad" and you get the messagebox and the form doesn't load.
>
>>Actually i started out using a form property for this - like TablesOpenedOK. After an error is trapped in DE, I update ThisForm.TablesOpenedOk WITH .F.
>>
>>But when it's evaluated in the Form's Load, it still is true! Hence, i 'settled' for a public memvar.
>>
>>I tracked program flow via Debugger... the Error is trapped alright, but when flow reaches Form.Load the property seems to be 're-initialized'...