Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing Program Sytles - help
Message
From
07/10/2000 20:37:29
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00426533
Message ID:
00426557
Views:
29
Bob,

In the Main program,
*!* Create Form handler to keep oForms in scope
*!* No need to make this Public if it's in Main.
DIMENSION gaForms(1)
gaForms = []
When you need to run a form:
= libRunFrm([frmMyForm])
And this goes in your code library:
FUNCTION libRunFrm
    LPARAMETERS pcClassName
    LOCAL lnNewFormPosition, loNewForm, lnOldSelect
	
    lnOldSelect = SELECT()
			
    *!* Get the array position where we will add an object
    lnNewFormPosition = ALEN(gaForms, 1) + 1

    *!* Add another form object to the array
    DIMENSION gaForms(lnNewFormPosition)
    gaForms(lnNewFormPosition) = CREATEOBJECT(pcClassName)
		
    SELECT (lnOldSelect)

    *!* Show the form 	
    gaForms(lnNewFormPosition).SHOW()	

ENDFUNC
>At devcon, I learned a new way, to create forms, using classes, etc,
>now I am in the process changing the way I code,
>instead of do form xxx
>I am issuing a prg like
>oc = create("form")
>oc.Show()
>
>etc,
>from the command line, everthing thing works just fine, however, if I put these two lines of code in a prg, (called from a menu) the form flashes for a second, the is gone.
>
>I assume its becuase the oc is no longer a var after the .prg is finished.
>
>
>What do you guys do to get arround, this, I am sure its simple, but the conecpt is just a bit new for me to figure it out.
>
>thank you
>
>Bob Lee
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform