Information générale
Catégorie:
Codage, syntaxe et commandes
Thanks to all of you who have shared thoughts on this subject. I gave it a try in my current application and this is what I found. In the load event of my first form I place:
private frmSwitchboard
frmSwitchboard = thisform
Then in a button on frmSwitchboard I place
frmSwitchboard.visible = .f.
do form frmForm2
In the destroy event of frmForm2 I place
frmSwitchboard.visible = .t.
At this point I get an error that effectively says it can't see frmSwitchboard. Now if frmForm2 was called by frmSwitchboard, why can't frmForm2 see it?
Incidentally, if I replace the PRIVATE statement with a PUBLIC one, the problem goes away.
- Don
>>Hi,
>>
>>>>I don't use any PUBLIC variables. In my Main.prg, I create a PRIVATE var,
>>
>>So what's the difference between a PUBLIC var and a var declared as PRIVATE at the top level ?
>>
>>Regards,
>>Viv
>
>One difference comes to mind - goApp loses being immune to "release all" command if declared as PRIVATE. ie:
>
>*Main1.prg
>PRIVATE goApp
>*...
>
>*Some procedure
>release all && goApp is released - wouldn't if declared as PUBLIC w/o extended clause
>
>IOW I'm with you. I declare it as PUBLIC if not using Application object instead.
>Cetin
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement