Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PRG Classes and Forms
Message
From
11/07/2007 00:07:11
 
 
To
10/07/2007 15:19:20
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01239057
Message ID:
01239166
Views:
12
>I think this won't work, but I want to have a method in my form that calls a method and in that method classes are defined... or something like that. Can I mix forms with text-based classes? Do I have to put them into the Main program that calls the form? Thanks!

I don't know what you are trying to accomplish, but in any case this is what I'd do if I wanted to create a class definition in a form method (or any other class method):
TEXT TO lcClassDef TEXTMERGE NOSHOW
*-- Just an example of a form class:
DEFINE CLASS MyFormClass AS Form
	Backcolor = 0
	LEFT = 0
	TOP = 0
ENDDEFINE

ENDTEXT
*
THISFORM.cClassDefinition = FORCEPATH(FORCEEXT(SYS(2015),"PRG"),GETENV("TEMP"))
*
STRTOFILE(lcClassDef,THISFORM.cClassDefinition,0)
COMPILE (THISFORM.cClassDefinition)
*
*-- In another method in your form call first the code above in a method and then instantiate your class that way:
loForm = NEWOBJECT("MyFormClass",THISFORM.cClassDefinition)
loForm.SHOW(1)
HTH
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform