Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Thisform.release() from form's DE
Message
De
05/06/2004 00:45:57
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00908137
Message ID:
00910291
Vues:
24
David,

This was how I did it. Your comments please.
* FORM.DataEnvironment.Error
LPARAMETERS nError, cMethod, nLine

IF "OpenTables" $ cMethod
   ThisForm.OpenFileError = .T.   && Weird: changed value not reflect in Form.LOAD()
ENDIF

* FORM.Load
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'...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform