this is what I have
'variables defined as arrays
Dim ceday(), ceti(), ceto(), ceproj(), cenotes() As String
Dim cerow As Int32
Private Sub cboEmpName_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
cboEmpName.SelectedIndexChanged
Dim ename As String
cerow = 2
ename = cboEmpName.SelectedItem
EditInfo(ename, cerow, ceday(), ceti(), ceto(),ceproj () , cenotes())
'finish doing stuff
End Sub
'in another module
Public Sub EditInfo(ByVal empname As String, ByRef i As Int16, ByRef
ceday() As Array, ByRef ceti() As Array, ByRef ceto() As Array, ByRef
ceproj() As Array, ByRef cenotes() As Array)
'do stuff
i = XLObj.activesheet.Cells(1,1).currentregion.rows.co unt
ReDim ceday(i), ceti(i), ceto(i), ceproj(i), cenotes(i)
'do more stuff
End Sub
the arrays in Private Sub cboEmpName_SelectedIndexChanged have the ()
underlined in blue and the message is:
Number of indicies is less than the number of dimensions of the indexed
array.
Since these are all one dimension arrays I do not understand why this
error is showing up.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! 4 1667
Your method EditInfo is expecting an array of Arrays while you are passing
in an array of strings. Change the definition of your method to:
Public Sub EditInfo(ByVal empname As String, ByRef i As Int16, _
ByRef ceday() As String, ByRef ceti() As String, _
ByRef ceto() As String, ByRef ceproj() As String, _
ByRef cenotes() As String)
Alternatively, you could also change it to:
Public Sub EditInfo(ByVal empname As String, ByRef i As Int16, _
ByRef ceday As Array, ByRef ceti As Array, _
ByRef ceto As Array, ByRef ceproj As Array, _
ByRef cenotes As Array)
Personally, I would go with the first one.
hope that helps..
Imran. this is what I have
'variables defined as arrays
Dim ceday(), ceti(), ceto(), ceproj(), cenotes() As String
Dim cerow As Int32
Private Sub cboEmpName_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboEmpName.SelectedIndexChanged
Dim ename As String
cerow = 2
ename = cboEmpName.SelectedItem
EditInfo(ename, cerow, ceday(), ceti(), ceto(),ceproj () , cenotes())
'finish doing stuff
End Sub
'in another module
Public Sub EditInfo(ByVal empname As String, ByRef i As Int16, ByRef ceday() As Array, ByRef ceti() As Array, ByRef ceto() As Array, ByRef ceproj() As Array, ByRef cenotes() As Array)
'do stuff
i = XLObj.activesheet.Cells(1,1).currentregion.rows.co unt
ReDim ceday(i), ceti(i), ceto(i), ceproj(i), cenotes(i)
'do more stuff
End Sub
the arrays in Private Sub cboEmpName_SelectedIndexChanged have the () underlined in blue and the message is: Number of indicies is less than the number of dimensions of the indexed array. Since these are all one dimension arrays I do not understand why this error is showing up.
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
both options produce the same effect for me as what I had expressed
before. It says:
Number if indicies is less than the number of dimensions of the indexed
array.
Public Sub EditInfo(ByVal empname As String, ByRef i As Int16, ByRef
ceday() As String, ByRef ceti() As String, ByRef ceto() As String, ByRef
ceproj() As String, ByRef cenotes() As String, ByRef ceworked() As
String)
is what i have here now. the little blue line is under the () in the
line
EditInfo(ename, cerow, ceday(), ceti(), ceto(), ceproj(), cenotes(),
ceworked())
and when I hover the mouse over the () the message appears in the tool
tip box.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Erik,
Have you tried:
EditInfo(ename, cerow, ceday, ceti, ceto, ceproj, _
cenotes, ceworked)
Note there are no () when you pass an array as a parameter.
Hope this helps
Jay
"Erik Foreman" <Er**@devedx.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl... both options produce the same effect for me as what I had expressed before. It says: Number if indicies is less than the number of dimensions of the indexed array.
Public Sub EditInfo(ByVal empname As String, ByRef i As Int16, ByRef ceday() As String, ByRef ceti() As String, ByRef ceto() As String, ByRef ceproj() As String, ByRef cenotes() As String, ByRef ceworked() As String)
is what i have here now. the little blue line is under the () in the line
EditInfo(ename, cerow, ceday(), ceti(), ceto(), ceproj(), cenotes(), ceworked())
and when I hover the mouse over the () the message appears in the tool tip box.
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
You are exactly correct. Everyting works perfectly now. Thank you very
much.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Bo Peng |
last post by:
Dear list,
I am writing a Python extension module that needs a way to expose pieces
of a big C array to python. Currently, I am using NumPy like the following:
PyObject* res =...
|
by: Alex Vinokur |
last post by:
Various forms of argument passing
=================================
C/C++ Performance Tests
=======================
Using C/C++ Program Perfometer...
|
by: jr |
last post by:
Sorry for this very dumb question, but I've clearly got a long way to go!
Can someone please help me pass an array into a function. Here's a starting
point.
void TheMainFunc()
{
// Body of...
|
by: NM |
last post by:
Hello all,
I am supposed to do some mixed programming with c++ and fortran.
I was succeeful in exchanging the 2D arrays from fortran to c++ and the
other way, but was unable
to that same with...
|
by: SV |
last post by:
Dear all,
In my application I have a lot of hidden fields. I want to make them invisible
for the users though for debugging reasons I want to make them visible. So I
want to add these objects to...
| |
by: Richard Buckshaw |
last post by:
Mimick the older C/ pascal dll parameter passing convention? - VB Class Mod?
Hello,
I have been attempting to write a VB class that would
expose its stuff to an older (ok, legacy application)...
|
by: Steve |
last post by:
Hello,
I created a public Structure in a Standard Module and also
an array of Structures. Then I load data into the array
of structures in a public sub that I call on the Form load
event. ...
|
by: John Pass |
last post by:
Hi,
In the attached example, I do understand that the references are not changed
if an array is passed by Val. What I do not understand is the result of line
99 (If one can find this by line...
|
by: goetzie |
last post by:
I am using Python 2.4.1 and Numeric 23.8 and running on Windows XP. I
am passing a Numeric array of strings (objects) to a C Extension module
using the following python code:
import Numeric...
|
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,...
|
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...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |