passing an array as a set of parameter in a function

clive2002

Registered User.
Local time
Today, 07:02
Joined
Apr 21, 2002
Messages
91
I have a set of four parameters completed by the user on a form.

I want to pass these to a function as parameters, would it be possible to use an array type declaration to do this.

at the moment i have something like the below.

Function EnterJourney(Crew As Integer, Stage1 As Boolean, MovementType1 As Integer, ToLoc1 As String, ToLat1 As Double, FromLong1 As Double, ToLoc1 As String, ToLat1 As Double, ToLong1 As Double, Stage2 As Boolean, MovementType2 As Integer, ToLoc2 As String, ToLat2 As Double, FromLong2 As Double, ToLoc2 As String, ToLat2 As Double, ToLong2 As Double, Stage3 As Boolean, MovementType3 As Integer, ToLoc3 As String, ToLat3 As Double, FromLong3 As Double, ToLoc3 As String, ToLat3 As Double, ToLong3 As Double, Stage4 As Boolean, MovementType4 As Integer, ToLoc4 As String, ToLat4 As Double, FromLong4 As Double, ToLoc4 As String, ToLat4 As Double, ToLong4 As Double)

i'd prefer something like this
Function EnterJourney(Crew As Integer, Stage(1 to 4) As Boolean, MovementType(1 to 4) As Integer, ToLoc(1 to 4) As String, ToLat(1 to 4) As Double, FromLong(1 to 4) As Double, ToLoc(1 to 4) As String, ToLat(1 to 4) As Double, ToLong(1 to 4) As Double)

any help??
 
Here is the method:

Code:
Dim s(1 to 10) As Array
Dim v As Variant

v = SomeFunction(s())
 

Users who are viewing this thread

Back
Top Bottom