JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: Constants as an Array Archived to Disk
If you put a module, or if you have one form, you can also do the following:
' In a module, or form if only used in 1 form:
Public mdbl_A(43) As Double
Public mdbl_B(43) As Double
Public mdbl_C(43) As Double
Option Explicit
Public Function Init() As Boolean
On Error Goto Err_Init
mdbl_A(1) = 2: mdbl_B(1) = 3: mdbl_C(1) = 11.375
mdbl_A(2) = 1: mdbl_B(2) = 0: mdbl_C(2) = 9.25
...
mdbl_A(43) = 0: mdbl_B(43) = 5: mdbl_C(43) = 0.25
Init=True
Exit Function
Err_Init:
Init=False
End Function
Public Function DeInit() as Boolean
' Not needed, but if you'd want
On Error Goto Err_DeInit
Erase mdbl_A
Erase mdbl_B
Erase mdbl_C
DeInit=True
Exit Function
Err_DeInit:
DeInit=False
End Function
' In the form:
Private Sub Form_Load()
Init
End Sub
|