' ========================================================================================================================
' ____,__, __, ____,_, _, ____ ____,__, ,____,____,
' (-/_|(-| (-| (-|_,(-|\ | (-|__|-/_|( |_/(-|_,(-|__)
' _/ |,_|__,_|__,_|__,_| \|, _|__)/ |,_| \,_|__,_| \,
'
' Copyright 2011 Allen Baker
'
' ------------------------------------------------------------------------------------------------------------------------
' File: M003_Globals
' Originator: Allen Baker (2011.03.13 21:10)
' ------------------------------------------------------------------------------------------------------------------------
' $RCSfile$
' $Revision$
' $Date$
' ========================================================================================================================
'
Option Explicit
' ========================================================================================================================
' Description
' This module provides a place for routines to place text or values that would be useful to their calling routines. An
' example of its usefullness is a Boolean Function that returns False if it fails. It would be nice to have a place
' where text describing the reason for the failure could be put and be made available to the routine that called the
' Boolean Function. The alternative to using a global like this is to pass a Output String parameter down through all
' the functions in the call stack.
' ========================================================================================================================
' =====================================================================================================================
' @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[ Constants ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' =====================================================================================================================
'
' ==============================================================================================
' multiple instances of the global variables of each type are provided. They may be used for
' any purpose. This constant sets how many are provided.
' ----------------------------------------------------------------------------------------------
Public Const cNumGlobals As Long = 20
' =====================================================================================================================
' @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[ Module Variables ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' =====================================================================================================================
'
' ==============================================================================================
' This is a place for routines to place text that would be useful to their calling routines.
' An example of its usefullness is a Boolean Function that returns False if it fails. It would
' be nice to have a place where text describing the reason for the failure could be put and be
' made available to the routine that called the Boolean Function. The alternative to using a
' global like this is to pass a Output String parameter down through all the functions in the
' call stack.
' ----------------------------------------------------------------------------------------------
Public gMsg(1 To cNumGlobals) As String
Public gInt(1 To cNumGlobals) As Long
Public gDbl(1 To cNumGlobals) As Double
' =====================================================================================================================
' @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[ Public Routines ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' =====================================================================================================================
' ===========================================================================================================
' ===========================================================================================================
' ===========================================================================================================
' This subroutine displays gMsg in a message box with the specified title and then clears out gMsg
'
' param
' pTitle is the title that will go on the message box
' param (optional)
' pIdx is the index of the gMsg aray to use. By default it is 1.
' -----------------------------------------------------------------------------------------------------------
Public Sub gMsgBox(pTitle As String, Optional pIdx As Long = 1)
Call MsgBox(gMsg(pIdx), vbOKOnly, pTitle)
gMsg(pIdx) = ""
End Sub
' ===========================================================================================================
' ===========================================================================================================
' ===========================================================================================================
' This subroutine displays gMsg in the log sheet and then clears out gMsg
'
' param
' pTitle is the title that will go on the log message
' param (optional)
' pIdx is the index of the gMsg aray to use. By default it is 1.
' -----------------------------------------------------------------------------------------------------------
Public Sub gLogMsg(pTitle As String, Optional pIdx As Long = 1)
Call logMsg("!! " & pTitle & " ==> " & gMsg(pIdx))
gMsg(pIdx) = ""
End Sub
' =====================================================================================================================
' @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[ Private Routines ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' =====================================================================================================================
Copyright © 2012 Allen Baker
|