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!

Passing array variable to sub

Status
Not open for further replies.

fordtran

Programmer
Jun 15, 2005
101
ZA
When I use CALL MySub A,B() in which B is an array, I get an error. How do I pass an array variable of a variable quantity of entries in the array to a sub. I cannot use B(10) or B(1 to 10) as it may be 20 and it does not take the foregoing syntax.
Thanks

fordtran
 
When use use Call (and there is no need to) you should enclose the arguments in brackets as follows;

Call MySub (A,B())

if you don't use Call then;

MySub A,B()

regards Hugh
 
dim b(10) as string

bozo b

sub bozo(b() as string)
...
end sub

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top