SaveAs, SaveAsClass
These two very cool methods let you create a form or object, make changes, then save the changed form or object (or some control on it) for future use. They're incredibly handy when you're trying to get something just right. These two methods work only on visual objects—one more argument for doing everything in VCXs rather than in code—though we hope that limit will go away eventually, leading to true "two-way tools."Like many of the non-event methods, you're likely to simply use the built-in versions rather than replace or supplement them with your own code.
Usage |
PROCEDURE oObject.SaveAs LPARAMETERS cFileName [, oDEName ] ) |
Usage |
PROCEDURE oObject.SaveAsClass LPARAMETERS cClassLib, cClassName [, cDescription ] |
Example |
* Execute these commands from the Command Window, * substituting your form for MyForm DO FORM MyForm * Choose a new backcolor WITH _SCREEN.ActiveForm .BackColor = GETCOLOR() .Caption = "Testing SaveAs" .SaveAs("MyNewForm") ENDWITH * If we want to add a new data environment, we need * to remove the old one _SCREEN.ActiveForm.RemoveObject("DataEnvironment") * Now create a new one oDE = CREATEOBJECT("DataEnvironment") * Change its name just so we can see the difference oDE.Name = "TestDE" * Now save a new form _SCREEN.ActiveForm.SaveAs("MyNewDEForm",oDE) * Now save a class from this form _SCREEN.ActiveForm.SaveAsClass("Test","MyNewForm", ; "Testing SaveAsClass") * Now you can close the original form and * check out the various clones |
See Also |
ActiveForm, Create Class, Create ClassLib, CreateObject, Do Form, _Screen, Set ClassLib |