次の方法で共有


MODIFY CLASS Command

Opens the Class Designer, making it possible for you to modify an existing class definition or create a new class definition.

MODIFY CLASS ClassName [OF ClassLibraryName1]
   [AS cBaseClassName [FROM ClassLibraryName2]]
   [NOWAIT] [METHOD MethodName] [SAVE]

Parameters

  • ClassName
    Specifies the name of the class definition to modify or create.

  • OF ClassLibraryName1
    Specifies the name of the .vcx visual class library containing the class definition. If you are creating a new class definition and the .vcx visual class library already exists, the class definition is added to it.

    A .vcx file extension is assumed for the visual class library. Be sure to include the file extension if the visual class library you specify has a file extension other than .vcx.

    If the .vcx visual class library you specify is currently in the SET CLASSLIB search list, the visual class library is removed from the search list.

  • AS cBaseClassName
    Specifies the class on which the class definition is based. cBaseClassName can be any of the Visual FoxPro base classes except Column, Cursor, DataEnvironment, Header, Page, and Relation. You can also specify a user-defined class for cBaseClassName if you include the FROM ClassLibraryName2 clause that specifies the name of the .vcx visual class library containing the user-defined class.

    If you omit AS cBaseClassName, the class definition is based on the Visual FoxPro FormSet base class.

  • FROM ClassLibraryName2
    Specifies the name of the .vcx visual class library containing the user-defined class specified with cBaseClassName.

  • METHOD MethodName
    Specifies an event or method for which the Code window is opened in the Class Designer. The METHOD clause makes it possible for you to immediately begin editing event or method code in the Class Designer.

    MethodName supports the Visual FoxPro object syntax. For example, to immediately edit the Click event code for a text box named txtFirstName in the class named MyClass in a visual class library named MyClassLibrary, use the following command:

    MODIFY CLASS MyClass OF MyClassLibrary;   METHOD txtFirstName.Click
    

    If you only include an event or method name in the METHOD clause, the Code window is opened for the class's event or method. For example, to immediately edit the Click event code for a class named MyClass in a visual class library named MyClassLibrary, use the following command:

    MODIFY CLASS MyClass OF MyClassLibrary METHOD Click
    
  • NOWAIT
    Continues program execution after the Class Designer is opened. The program doesn't wait for the Class Designer to be closed, but continues execution on the program line immediately following the line that contains MODIFY CLASS NOWAIT. If you omit NOWAIT when MODIFY CLASS is issued in a program, the Class Designer is opened and program execution pauses until the Class Designer is closed.

    NOWAIT is effective only from within a program. It has no effect on MODIFY CLASS when issued from the Command window. If NOWAIT is included with the METHOD clause, be sure to place NOWAIT before the METHOD clause or NOWAIT will be ignored.

  • SAVE
    Leaves the Class Designer open after another window is activated. If you omit SAVE, the Class Designer is closed when another window is activated. Including SAVE has no effect when issued from the Command window.

Remarks

Use MODIFY CLASS to modify an existing class definition or to create a new class definition and save it in a .vcx visual class library. You can open the .vcx visual class library with SET CLASSLIB, making it possible for you to access the class definitions within the .vcx visual class library.

See Also

ADD CLASS | CREATE CLASS | CREATE CLASSLIB | RELEASE CLASSLIB | SET CLASSLIB