Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Run code one time only within a subroutine


Sub AnySubroutine()
Static initialized As Boolean
If Not initialized Then
    'put code here that will be executed one time only
   initialized = True
End If
'put code here that will run every Time Sub Is called
End Sub