Name
Static Statement
Synopsis
Staticvarname
[([subscripts
])] [As [New]type
] _ [,varname
[([subscripts
])] [As [New]type
]] ...
varname
required; anyThe name of the variable, following Visual Basic naming conventions
subscripts
optional; IntegerDenotes
varname
as an array and specifies the dimension and upper bounds of the arrayNew
optional; KeywordUsed to automatically create an instance of the object referred to by the object variable
varname
type
optional; KeywordData type of the variable
varname
Description
Used at procedure level to declare a Static variable and to allocate the relevant storage space in memory. Static variables retain their value between calls to the procedure in which they are declared.
Get VB.NET Language Pocket Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.