>I have some forms that I have defined as MODELESS so that other forms may be run. However, I only want the user to be able to run a single instance of a particular form. If the menu selection is made for a form that is already running, I want to change the focus to the existing form instead of creating a new form.
Dave's idea is similar to the solution I've used. When the user selects an option which should either create a form or give it focus, use a function which searches for the form in the _SCREEN.Forms collection. If found, do _SCREEN.Forms[count].Show (though actually ACTIVATE or SHOW WINDOW also still does it, and WEXIST() returns the existence of a form).
>A second problem that I am having is how to I "clean-up" the MODELESS forms when the EXIT is selected from the menu. When I select EXIT, I get the command window (I am not quiting at this point), and the forms are floating around doing "their thing" until they are individually closed.
The simple answer to this is: see Form.Release. My ON SHUTDOWN routine (also called by Exit bar of File menu pad) does:
PROCEDURE AppClose
CLEAR EVENTS
FOR x=1 TO _SCREEN.FormCount
_SCREEN.Forms[m.x].Release
ENDFOR
DO CloseData
DO ResetEnvir
RETURN
Cheers,
Rich.
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing