>I had the form as a class. However, I need to let the user save it as a form, but not a form class. I tried using loForm.SaveAs(cProperty3) but it doesn't save it. It only saves when I specify a name like loForm.SaveAs("MyFilename"). Is there any way I can use a variable in SaveAs?<
Hi Chu,
I created two classes, BaseClass (subclass of Form) and SubClass, subclass of BaseClass.
I then used the following code:
loObject = CREATEOBJECT("SubClass")
WITH loObject
.Property1 = "Test"
.Property2 = "Data"
.Property3 = "TestForm"
.SaveAs(.Property3)
ENDWITH
and it created a form TestForm.SCX whose parent was SubClass and whose properties were set as loObject's had been.
You may have forgotten to reference cProperty as a property: loForm.SaveAs(loForm.cProperty3)
>
>Besides, I have another question. Once I have the form saved, how can I add it to the project programmatically? Thanks a lot.
For VFP5 you'll have to hack the PJX file, unless someone already has a set of classes to do it. For VFP6, a project object has been added, which will make your task easier.
HTH,
Ned
Ned
Reality is.