Groups > dBase > dBase bug reports > Re: Weird Problem with findInstance() and Closing Forms




Weird Problem with findInstance() and Closing Forms

Weird Problem with findInstance() and Closing Forms
Thu, 07 Feb 2008 07:07:09 -080
I have run into a truly bizarre problem with using findInstance() to 
ensure that some forms are closed. I have a couple of forms I'm trying 
to make sure are not open constantly, eating memory, and all that.

In the startup code for each form, I check to see if the other is open, 
and if so, I release it. I use findInstance to do it.

This should allow me to open one form from the other, and vice versa, 
and allow for this to continue to loop through the cycle. However, watch 
what happens with the two attached forms.

Run one of them (doesn't matter which). Click the button. It opens the 
other form, then closes the first one. However, click the button on the 
second form, and it closes the current form without opening the other 
one. Something odd is happening here, and I have no clue what ...

I have tried using _app to store references to the forms, that made no 
difference.

These are sample forms, not the real ones I use (very complicated) but 
they show the exact same behavior I'm seeing in the real application. 
This is a serious problem.

Ken
-- 
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase

Post Reply
Re: Weird Problem with findInstance() and Closing Forms
Thu, 07 Feb 2008 09:07:32 -080
For what it's worth, after some testing, it may work if, rather than in 
code called in the ReadModal() event handler (in this case, the 
ReadModal() method's overrriden code calls the form's Init() method), if 
I put the code that closes the other form in the current form's onOpen 
event handler ... I'm doing more testing on this ...

Ken

-- 
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
Post Reply
Re: Weird Problem with findInstance() and Closing Forms
Thu, 07 Feb 2008 09:16:13 -080
As a follow up:

For what it's worth, moving the code that is in the INIT method of the 
attached forms, to the onOpen event (in both forms) seems to resolve the 
issue.

I don't know if this is a bug or not, but it's certainly a weird (to me, 
anyway) one ...

Ken

-- 
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
Post Reply
Re: Weird Problem with findInstance() and Closing Forms
Thu, 07 Feb 2008 13:50:16 -080
Ivar B. Jessen wrote:
> On Thu, 07 Feb 2008 07:07:09 -0800, in dbase.bug-reports, 
> Subject: Weird Problem with findInstance() and Closing Forms, 
> Message-ID: <7m9DL3ZaIHA.940@news-server>,  
> "Ken Mayer [dBVIPS]" <dbase@_nospam_goldenstag.net> wrote:
> 
> 
>> These are sample forms, not the real ones I use (very complicated) but

>> they show the exact same behavior I'm seeing in the real application. 
>> This is a serious problem.
> 
> I can make it work with the following modification.
> 
> In quoteparts.wfm,
> 
>    function form_readModal
>       class::Init()      
>    //return QUOTEPARTSFORM::readModal()	
>      return QUOTEPARTSFORM::open()	
> 
> 
> In quoteInvoice.wfm,
> 
>    function form_readModal
>       class::Init()      
>  //return QUOTEINVOICEFORM::readModal()  	
>    return QUOTEINVOICEFORM::open()

I need them to be modal. These are DOS application users leaping into 
Windows, and the whole multi-document thing is a problem ... trust me. 
There are other things as well that require that these be modal. Sigh.

It's interesting though that it's only readmodal() for this issue ...

Ken

-- 
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
Post Reply
Re: Weird Problem with findInstance() and Closing Forms
Thu, 07 Feb 2008 20:27:14 +010
On Thu, 07 Feb 2008 07:07:09 -0800, in dbase.bug-reports, 
Subject: Weird Problem with findInstance() and Closing Forms, 
Message-ID: <7m9DL3ZaIHA.940@news-server>,  
"Ken Mayer [dBVIPS]" <dbase@_nospam_goldenstag.net> wrote:


>These are sample forms, not the real ones I use (very complicated) but 
>they show the exact same behavior I'm seeing in the real application. 
>This is a serious problem.

I can make it work with the following modification.

In quoteparts.wfm,

   function form_readModal
      class::Init()      
   //return QUOTEPARTSFORM::readModal()	
     return QUOTEPARTSFORM::open()	


In quoteInvoice.wfm,

   function form_readModal
      class::Init()      
 //return QUOTEINVOICEFORM::readModal()  	
   return QUOTEINVOICEFORM::open()


Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact