The SaveAs method create a SCX with this code and my original code was lost.
**************************************************
*-- Form: form1 (c:\temp\testeform\myform.scx)
*-- ParentClass: form1
*-- BaseClass: form
*-- Time Stamp: 04/19/06 03:02:13 PM
*
DEFINE CLASS form1 AS form1
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
Command11.Caption = "Click me"
Command11.Name = "Command1"
ENDDEFINE
>Hi,
>
>I to use the SaveAs mothod, but when I try to modify the form VFP generate an error message.
>
>Look my example.
>
>Local loForm as Form
>loForm = NewObject("form1")
>loForm.SaveAs("MyForm") - Save the class to MyForm by your instruction
>Modify form MyForm - generate "Error loading file" message
>
>---
>Microsoft Visual FoxPro
>OK
>Help
>Error loading file - record number 2. Form1 or one of its members
>Parent : Class definition FORM1 is not found
>---
>
>DEFINE CLASS form1 AS form
> DoCreate = .T.
> Caption = "Form1"
> Name = "Form1"
> ADD OBJECT command1 AS commandbutton WITH ;
> Top = 12, ;
> Left = 12, ;
> Height = 27, ;
> Width = 84, ;
> Caption = "Click me", ;
> Name = "Command1"
> Procedure command1.Click
> MessageBox("Click")
> EndProc
>EndDefine
>