
394
|
Chapter 12: The Language Reference
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Partial Keyword
Syntax
Partial Class className
[statements]
End Class
or:
Partial Structure structureName
[statements]
End Structure
These two syntax examples show only the minimal grammar for the Class and
Structure statements, for demonstration of the Partial keyword only.
Description
The Partial keyword allows a single class or structure definition to be divided into
multiple source code files. At least one of the class or structure portions must include
the
Partial keyword.
For syntax details on using the Partial keyword in context, see the Class...End Class
Statement and the Structure...End Structure Statement entries elsewhere in this chapter.
Example
This example shows a class divided into two distinct files. The first source code file
includes the following code.
Public Class Customer
...statements...
End Class
The second source code file includes this code.
Public Partial Class Customer
...more statements...
End Class
If desired, the Partial keyword could be added to both class component definitions.
Version Differences
The Partial keyword was introduced with Visual Basic 2005.
See Also
Class...End Class Statement, Structure...End Structure Statement
Partition Function
Class
Microsoft.VisualBasic.Interaction
Syntax
Dim result As String = Partition(number, ...