Subject Re: closing form
From Milind Nighojkar <milinigh@yahoo.com>
Date Thu, 25 Nov 2021 12:14:50 -0500
Newsgroups dbase.getting-started

Hi Ken,
Thanks for the pointer.
I already had adopted that as per your earlier reply on 'progress bar' query I had raised few days back.

Additionally I observed that I had made a minor mistake in form declaration say f = new app_form() which is the main form and
other forms called from this form had same declaration f = new app_form(). It seems it got clashed.

I changed the declaration and gave different  names and problem got resolved of closing form and memerory access denied issue.

Regards
Milind Nighojkar

Ken Mayer Wrote:

> On 11/22/2021 6:18 AM, Milind Nighojkar wrote:
> > Scenerio. form A is opened
> > Wanted to close this form
> > Iuused a syntax : CLOSE FORMS A
> > Get error : No such form A
> >
> > Any suggestions
>
> How are you opening form a?
>
> do forma.wfm
>
> or
>
> set procedure to forma.wfm
> fFormA = new formaForm()
> fFormA.open()
>
> ? It makes a huge difference.
>
> If you're doing it the first way, that gets tricky, and as Akshat points
> out, you should look at findInstance().
>
> However, I almost never use the first way, because the second gives me
> the ability to directly control the forms. If I have a situation where
> my code is doing a bunch of stuff, and I need to close form A from it,
> using the above method, I can do:
>
> fFormA.close()
>
> And that will do the trick.
>
> Ken
>
>
> --
> *Ken Mayer*
> Ken's dBASE Page: http://www.goldenstag.net/dbase
> The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
> dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
> dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
> dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm