Subject Re: Menu inactive on first screen firm
From Pieter van Heerden <psvh@mweb.co.za>
Date Thu, 10 May 2018 03:10:32 -0400
Newsgroups dbase.getting-started

Andy,

The setup program now works, but it still does not solve the original menu non-activity problem.  Thanks so far.

Andy Taylor Wrote:

> Pieter,
>
> The mistake is mine... (slaps forehead)
>
> I gave you a class directive :: and of course tableSetup is merely
>  a function within setup.prg, it is not a function within a class.
> So _app.startcomplete = tableSetup() is the proper call.
>
> Andy
>
> > Pieter,
> > Try just _app.startcomplete = tableSetup()
> > That should work as long as you don't have the same function name anywhere else.
> > Andy
> >
> > > Aandy
> > >
> > > This is the line that generates the error message
> > > _app.startcomplete = setup::tablesetup()
> > >
> > > There is a return true at the end of the function.
> > >
> > >
> > > Andy Taylor Wrote:
> > >
> > > > Pieter,
> > > > Is it the typo? _app.startconplete
> > > > You also need to return true at the end of the function...
> > > > Andy
> > > >
> > > > > Andy, I've added the function as you advised, but now get an error message indicating that the added function is not  a member of the class or base class.  I went through the normal routine of adding a new method after the return of the main program and have never had problems like this before. Last code lines of the original code and the first of the  new function is as follows:
> > > > >
> > > > > f.setFocus()      
> > > > > set procedure to "irrireq.wfm" additive
> > > > > return true
> > > > > // end of main routine, we can store any functions here that we
> > > > > // might want to use for multiple parts of the application ...
> > > > >
> > > > > function tablesetup
> > > > >         // Delete dBase temporary tables in the SAPWAT directory
> > > > >         aFiles = new Array() // Array will be resized as needed
> > > > >         nFiles = aFiles.dir("_qsql*.*")
> > > > >
> > > > > And the calling routine is:
> > > > > // Shift table functions to a seperat function
> > > > > _app.startcomplete = false
> > > > > _app.startconplete = setup::tablesetup()
> > > > > do while not _app.startcomplete
> > > > >         _app.executemessages()
> > > > > enddo
> > > > >
> > > > > Andy Taylor Wrote:
> > > > >
> > > > > > Pieter,
> > > > > >
> > > > > > Nothing obvious in there, although you do quite a lot of stuff for a start program :-)
> > > > > >
> > > > > > In order to be sure that it has all finished try wrapping some of the big stuff into a function
> > > > > > and calling it with say:
> > > > > >
> > > > > > _app.startComplete = false
> > > > > > _app.startComplete = setup::tableSetup()
> > > > > > do while not _app.startComplete
> > > > > >    _app.executeMessages()
> > > > > > enddo
> > > > > >
> > > > > > function tableSetup
> > > > > >    all your table Management stuff cut and pasted from higher up...
> > > > > >    return true
> > > > > >
> > > > > > That way you can be sure that nothing else is going on while you are instantiating the first form.
> > > > > > Something MUST be stopping the form menu completing properly if you can return to the form later
> > > > > >  and the menu be working correctly.  It's just a case of isolating where this blockage happens in the code.
> > > > > >
> > > > > > Andy
> > > > > >  
> > > > > > > Andy,
> > > > > > >
> > > > > > > I've attached the setup program from which the opening screen is called.
> > > > > > >
> > > > > > > Andy Taylor Wrote:
> > > > > > >
> > > > > > > > Pieter,
> > > > > > > >
> > > > > > > > It sounds like the menu instantiation code has only partly taken place.
> > > > > > > > Are you doing something in your opening process that might interfere with proper creation?
> > > > > > > > Are both forms mdi forms?
> > > > > > > > We might need to see some code.
> > > > > > > >
> > > > > > > > Andy
> > > > > > > >
> > > > > > > > > dBase 11.3
> > > > > > > > >
> > > > > > > > > I have an application that opens on an information screen form with only a proceed button.  The problem is that the menu file that is linked to this form is only partly active.  Submenus can be opened, but no action takes place when selecting a specific menu item.  The initiation code for this form includes:
> > > > > > > > >
> > > > > > > > >      menuFile = \"SapwatMenu.mnu\"
> > > > > > > > >
> > > > > > > > > Pressing the proceed button takes the user to a next screen form that is also linked to the same meu file.  Now the menu is fully functional.  Closing the second form and returning to the first form: in this case the  menu system remains fully functional.
> > > > > > > > >
> > > > > > > > > I have tried setting focus to the first form with form.setfocus() in the form_opOpen code, but no joy.
> > > > > > > > >  
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>