How to Pass Array to a Function? 
Author Message
 How to Pass Array to a Function?

What's the syntax for passing an array to a function or subprocedure if
the definition of the array is

DIM Array(2,Max) as string



Sat, 23 Nov 2002 03:00:00 GMT  
 How to Pass Array to a Function?
Sub Yaggayahooee

DIM ArUgh(2,Max) as String

stuff stuff and more stuff
Define the contents of ArUgh stuff

    Burp ArUgh

stuff stuff and even more stuff

End Sub
________________________________________________

Sub Burp (ArPuffnStuff() as String)

Stuff stuff and more stuff

End Sub

Ken, when you run this arUgh array will be passed to Burp as the
arPuffnStuff array and vice versa if execution is passed back to
Yaggayahooee.

Basically, when you call the procedure/function, just place the
variables to be passed right after the name of the called procedure.
If you are passing multiple variables, place commas between the
variables.

When you declare the procedure, you need to define the passed variable
in parenthesis following the procedure name.

Did I confuse you yet?

George
da Dude

Sent via Deja.com http://www.deja.com/
Before you buy.



Sat, 23 Nov 2002 03:00:00 GMT  
 How to Pass Array to a Function?
Oops, made one mistake.

Should be () after Burp ArUgh

Correction is as follows for Sub Yaggayahooee:

 Sub Yaggayahooee

 DIM ArUgh(2,Max) as String

 stuff stuff and more stuff
 Define the contents of ArUgh stuff

     Burp ArUgh()

 stuff stuff and even more stuff

 End Sub

Sent via Deja.com http://www.deja.com/
Before you buy.



Sat, 23 Nov 2002 03:00:00 GMT  
 How to Pass Array to a Function?
Hi Ken,

Which version of Word (VB, actually) you're using plays a role, here. VB6
(2000) is a bit more forgiving than VB5.

Quote:
> What's the syntax for passing an array to a function or subprocedure if
> the definition of the array is

> DIM Array(2,Max) as string

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)



Sun, 24 Nov 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. question on passing and returning arrays from functions

2. pass an array as function/sub argument

3. Passing an array to API function

4. Question on passing array parameters to VB.NET Sub/Function

5. Passing of arrays to a function???

6. Passing arrays to a function

7. Passing arrays to functions

8. Passing Arrays to a Function in ASP (VBScript)

9. pass an array back from function

10. passing a control array to a function...

11. HELP: Passing an Array back in a function

12. Passing control array into global function - problem

 

 
Powered by phpBB® Forum Software