VBS tutorial: VBScript statement – class statement


Class statement

Declare the name of a class and the definitions of the variables, properties, and methods that make up the class.

Class name
End Class



Required.ClassThe name of the; Follow standard variable naming conventions.


Required. One or more statements that defineClassVariables, properties, and methods.


stayClassIn the block, members are declared asPrivateorPublic。 Declared private will onlyClassWithin the block is visible. Declared public not only inClassThe inside of the block is visible, rightClassCode outside the block is also visible. Not usedPrivateorPublicExplicitly declared are defaulted toPublic。 Declared inside a block of a class asPublicProcess of(SuborFunction)Methods that will become classes.PublicThe variable will become an attribute of the class, the same as usingProperty GetProperty LetandProperty SetProperties that are explicitly declared are the same. The default properties and methods of classes are used in their declaration sectionDefaultKeyword. Refer to the separate declaration topic for how to use this keyword.


Version 5