> For some reason, when I go to display this form again later, 
> it says "Form
> already loaded".
> I'm trying to establish if the lack of a formCloseEvent is 
> leaving the form
> loaded in memory.
> That's been my main problem from the start.
> 1. frmGotoForm(MainForm);
> 2. frmGotoForm(GameForm);
> 3. frmPopupForm(OtherForm); frmReturnToForm(0);
> 4. frmGotoForm(MainForm);
> 5. frmGotoForm(GameForm);
> 6. frmPopupForm(OtherForm);  <- Error: Form already loaded. 
> Simulator stops.

If you see this error, it's most likely that there is one path where you didn't return 
from the popup with FrmReturnToForm(0), but used a FrmGotoForm() instead (or before 
the FrmReturnToForm()). Step through your code with a debugger or post more code 
details.

> I've had a look through the archives of this list and see 
> examples of people
> saying "Don't ever try to use frmPopupForm.. it's terrible!".

There's really nothing broken with FrmPopupForm. It's sometimes a bit tricky to handle 
if you come to a form via different paths. The big advantage of a popup form is that 
you still have the underlying form loaded, and don't need to reinit etc. when you're 
done with the popup.

One important point is to never mix FrmPopupForm and FrmGotoForm to open the same 
form. 

The other is (as Ben already pointed out) that you don't get a frmCloseEvent when you 
do a FrmReturnToForm(), but you still get one if your popup is displayed at appStop 
via FrmCloseAllForms(). So be sure to have your form cleanup routine called in either 
case.

Andreas
www.linkesoft.com


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to