can you call an array with a variable name
can you call an array with a variable name
(OP)
If I am making a sub or function to perform a task with an array, can I call the array with a generic name so I don't have to rewrite the routine for each different array name? Forinstance, if I had ArrayA and ArrayB and wanted to change the first instance in each array to 4
strArrayName = "ArrayA"
Call ArrayRoutine
strArrayName = "ArrayB"
Call ArrayRoutine
sub ArrayRoutine()
strArrayName(0) = 4
end sub
strArrayName = "ArrayA"
Call ArrayRoutine
strArrayName = "ArrayB"
Call ArrayRoutine
sub ArrayRoutine()
strArrayName(0) = 4
end sub
RE: can you call an array with a variable name
Call ArrayRoutine (ArrayA)
Call ArrayRoutine (ArrayB)
Sub ArrayRoutine (TheArray)
TheArray(0) = 4
End Sub
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
RE: can you call an array with a variable name
RE: can you call an array with a variable name
RE: can you call an array with a variable name
Dim ArrayA(5) As Integer
Dim ArrayB(5) as Integer
Call ProcArray(ArrayA())
Call ProcArray(Arrayb())
---
Sub ProcArray(TheArray() As Integer)
End Sub
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
RE: can you call an array with a variable name