Skip to main content

Examples: Sub Initialize

' When LotusScript loads the module, Initialize saves the name
' of the current working directory.
Dim StartDir As String
Sub Initialize ' Store the current directory
StartDir$ = CurDir$
End Sub

' The module changes the working directory.
' ...
' ...

' When LotusScript unloads the module, Terminate changes the
' working directory back to what it was when the module was
' loaded.
Sub Terminate ' Return to the startup directory.
ChDir StartDir$
End Sub