Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving array items from a called procedure

Status
Not open for further replies.

Klopper

MIS
Dec 7, 2000
84
US
If I want to pass a array variable to another function, like so:
Sub OrinigalProcedure
...etc
Variable = CalledProcedure(PassedVariable())
...etc
End Sub

Where:
Function CalledFunction(PassedVariable() as Variant)
...etc
...etc
CalledFunction = Array(Item1, Item2)
End Function

What is the correct syntax to refer to each item in the array passed back to the original procedure?

TIA,
Klopper
 
I'm not sure that I right understood what results do you want to take, but... Mybe so?

Function CalledFunction(PassedVariable as Variant)
...etc
...etc
CalledFunction = PassedVariable(Item1, Item2)
End Function

Aivars
 
Returning an Array from a function???
Code:
Sub OrinigalProcedure
    Dim aryNew() as Variant
    aryNew = CalledFunction(PassedVariable())
End Sub
Function CalledFunction(PassedVariable() as Variant) as Variant()
    CalledFunction = Array(Item1, Item2)
End Function

Compare Code (Text)
Generate Sort in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top