12-10-2005, 04:09 AM
It's just bad practice. You can easily send an array to a sub like this...
By the way, it's FB code because of the underscores in the sub names, so it wont run in QB.
By the way, it's FB code because of the underscores in the sub names, so it wont run in QB.
Code:
Declare Sub Print_Data( tArray() As Integer )
Declare Sub Fill_Array( tArray() As Integer )
Dim Array(1 To 500) As Integer
Fill_Array( Array() )
Print_Data( Array() )
Sleep
'All of your subs can be way down here, out of the way, or even in a different file.
Sub Print_Data( tArray() As Integer )
Dim i
For i = Lbound(tArray) To Ubound(tArray)
Print tArray(i)
Next
End Sub
Sub Fill_Array( tArray() As Integer )
Dim i
For i = Lbound(tArray) To Ubound(tArray)
tArray(i) = Int(Rnd*1000)
Next
End Sub