473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

passing multiple arrays as parameters.

Hi Folks

I know that this is possible:
Function tt(x as string, nv())

where NV is an array.

What I am wondering is if NV can be a multidimensional array.

I checked the help, but found no information.

TIA

- Nicolaas
Nov 13 '05 #1
10 2695
WindAndWaves wrote:
Hi Folks

I know that this is possible:
Function tt(x as string, nv())

where NV is an array.

What I am wondering is if NV can be a multidimensional array.

I checked the help, but found no information.


Yes, you can pass multidimensional arrays.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #2
WindAndWaves wrote:
Hi Folks

I know that this is possible:
Function tt(x as string, nv())

where NV is an array.

What I am wondering is if NV can be a multidimensional array.

I checked the help, but found no information.


In the time it takes to get an answer here you could have tried it :-)

The answer's yes BTW.

--
This sig left intentionally blank
Nov 13 '05 #3
rkc
Trevor Best wrote:
In the time it takes to get an answer here you could have tried it :-)


As is the case for a majority of the questions asked.
Nov 13 '05 #4

"Trevor Best" <no****@besty.org.uk> wrote in message
news:41**********************@news.zen.co.uk...
WindAndWaves wrote:
Hi Folks

I know that this is possible:
Function tt(x as string, nv())

where NV is an array.

What I am wondering is if NV can be a multidimensional array.

I checked the help, but found no information.


In the time it takes to get an answer here you could have tried it :-)

The answer's yes BTW.

--
This sig left intentionally blank


Thanks for the answers guys.

I tried it:

Function yyy(x As Boolean, a())
MsgBox a(2, 1)
End Function
Function zzz()
Call yyy(True, 1, "yellow", 2, "orange", 3, "white", 4, "shit")
End Function

But it does not seem to like it ( i can not compile it)

Any hints?

- Nicolaas
Nov 13 '05 #5

"rkc" <rk*@rochester.yabba.dabba.do.rr.bomb> wrote in message
In the time it takes to get an answer here you could have tried it :-)


As is the case for a majority of the questions asked.


Usually writing up the question makes you think of the answer. I often
write up a question and come up with the answer while structuring my
question. However, sometimes it is nice to hear what other people think and
sometimes it is nice to share an idea and othertimes you end up with a
mental block.

All questions at newsgroups can be solved in other way, but you should never
blame people for asking stupid questions. That is what newsgroups are for.
If you have a real difficult question it is probably easier, faster and more
successful to hire someone.

well, that is just my one cent worth

- Nicolaas
Nov 13 '05 #6
rkc
WindAndWaves wrote:
"Trevor Best" <no****@besty.org.uk> wrote in message
news:41**********************@news.zen.co.uk...
WindAndWaves wrote:
Hi Folks

I know that this is possible:
Function tt(x as string, nv())

where NV is an array.

What I am wondering is if NV can be a multidimensional array.

I checked the help, but found no information.


In the time it takes to get an answer here you could have tried it :-)

The answer's yes BTW.

--
This sig left intentionally blank

Thanks for the answers guys.

I tried it:

Function yyy(x As Boolean, a())
MsgBox a(2, 1)
End Function
Function zzz()
Call yyy(True, 1, "yellow", 2, "orange", 3, "white", 4, "shit")
End Function

But it does not seem to like it ( i can not compile it)

Any hints?


I pretty sure shit is a reserved word. Try shucks.
Nov 13 '05 #7
WindAndWaves wrote:
Thanks for the answers guys.

I tried it:

Function yyy(x As Boolean, a())
MsgBox a(2, 1)
End Function
Function zzz()
Call yyy(True, 1, "yellow", 2, "orange", 3, "white", 4, "shit")
End Function

But it does not seem to like it ( i can not compile it)

Any hints?


Function yyy(x As Boolean, a As Variant)
MsgBox a(2)(1)
End Function

Function zzz()
Call yyy(True, Array(Array(1, "yellow"), Array(2, "orange"), _

Array(3, "white"), Array(4, "shit")))
End Function

'---------------
' John Mishefske
'---------------
Nov 13 '05 #8
rkc
WindAndWaves wrote:
Thanks for the answers guys.

I tried it:

Function yyy(x As Boolean, a())
MsgBox a(2, 1)
End Function
Function zzz()
Call yyy(True, 1, "yellow", 2, "orange", 3, "white", 4, "shit")
End Function

But it does not seem to like it ( i can not compile it)


I don't know what use you're trying to make of it, but as a
proof of concept...
Sub zzz()
Dim a(1, 2) As Variant
a(0, 0) = "yellow"
a(0, 1) = "orange"
a(0, 2) = "blue"
a(1, 0) = "lemon"
a(1, 1) = "tangerine"
a(1, 2) = "smurf"

Call yyy(True, a())
End Sub
Sub yyy(x As Boolean, a())
Dim i As Integer, j As Integer
Dim s As String

If x then
For i = 0 To UBound(a, 1)
For j = 0 To UBound(a, 2)
s = s & a(i, j) & vbCrLf
Next
Next
MsgBox s
End If
End Sub

Nov 13 '05 #9

"rkc" <rk*@rochester.yabba.dabba.do.rr.bomb> wrote in message
news:N2******************@twister.nyroc.rr.com...
WindAndWaves wrote:
Thanks for the answers guys.

I tried it:

Function yyy(x As Boolean, a())
MsgBox a(2, 1)
End Function
Function zzz()
Call yyy(True, 1, "yellow", 2, "orange", 3, "white", 4, "shit")
End Function

But it does not seem to like it ( i can not compile it)


I don't know what use you're trying to make of it, but as a
proof of concept...
Sub zzz()
Dim a(1, 2) As Variant
a(0, 0) = "yellow"
a(0, 1) = "orange"
a(0, 2) = "blue"
a(1, 0) = "lemon"
a(1, 1) = "tangerine"
a(1, 2) = "smurf"

Call yyy(True, a())
End Sub
Sub yyy(x As Boolean, a())
Dim i As Integer, j As Integer
Dim s As String

If x then
For i = 0 To UBound(a, 1)
For j = 0 To UBound(a, 2)
s = s & a(i, j) & vbCrLf
Next
Next
MsgBox s
End If
End Sub



Thanks a lot guys, yeah, it was just the syntax that I was unsure about. I
am making a function that add strings to a recordset. Usually, I just use
docmd.runsql(update ...or insert), but when you have unpredictable strings
with funny characters then it is easier to use
rst.addnew
rst.fields(xxx) = blah
rst.update

I have made the function, so now it would be really nice to be able to pass
a whole array of field names and values. I am still kind of working it out.
I will post the final function on here so that others may use it.

Thank you

- Nicolaas
Nov 13 '05 #10
WindAndWaves wrote:
"Trevor Best" <no****@besty.org.uk> wrote in message
news:41**********************@news.zen.co.uk...
WindAndWaves wrote:
Hi Folks

I know that this is possible:
Function tt(x as string, nv())

where NV is an array.

What I am wondering is if NV can be a multidimensional array.

I checked the help, but found no information.


In the time it takes to get an answer here you could have tried it :-)

The answer's yes BTW.

--
This sig left intentionally blank

Thanks for the answers guys.

I tried it:

Function yyy(x As Boolean, a())
MsgBox a(2, 1)
End Function
Function zzz()
Call yyy(True, 1, "yellow", 2, "orange", 3, "white", 4, "shit")
End Function


Try Split() function.

--
This sig left intentionally blank
Nov 13 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: PerfectDayToChaseTornados | last post by:
Hi All, I am trying to create a BeanHelper class which will set a beans values from the request much the same as it would be form a jsp using 'usebean'. I can get everything to work except for...
5
by: harry | last post by:
I have 2 multi-dim arrays double subTotals = null; String rowTitles = null; I want to pass them to a function that initialises & populates them like so - loadData( rowTitles, subTotals);
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
39
by: Mike MacSween | last post by:
Just spent a happy 10 mins trying to understand a function I wrote sometime ago. Then remembered that arguments are passed by reference, by default. Does the fact that this slowed me down...
17
by: mr.resistor | last post by:
hey i am having a few problems calling a C DLL from C#. i am using a simple function that takes an array of floats and an integer as an input, but i cannot seem to get it to work. when i try to...
2
by: sonaliagr | last post by:
I am trying to update a msg array in function by passing the address but it is showing an error. and also, i want the value of msg array to be accessible to the full code that is inside the main...
3
by: ZMan | last post by:
The following code won't compile with gcc version 3.4.2 (mingw-special). How come? Error: cannot convert `char (*)' to `char**' /**********************************************************/...
4
by: Nathan Sokalski | last post by:
I am a beginner with AJAX, and have managed to learn how to use it when passing single parameters, but I want to return more than one value to the client-side JavaScript function that displays it....
2
by: luis | last post by:
I'm using ctypes to call a fortran dll from python. I have no problems passing integer and double arryas, but I have an error with str arrys. For example: ..... StringVector = c_char_p *...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.