Name

Static Statement

Synopsis




Static varname[([subscripts])] [As [New] type] _
       [,varname[([subscripts])] [As [New] type]] ...
varname required; any

The name of the variable, following Visual Basic naming conventions

subscripts optional; Integer

Denotes varname as an array and specifies the dimension and upper bounds of the array

New optional; Keyword

Used to automatically create an instance of the object referred to by the object variable varname

type optional; Keyword

Data 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.