473,480 Members | 3,062 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Pass Array to function. Can't this be done?! Urgent. Thanks.

Hello,

I have this function:

Sub MyFunction(ByVal myString As String, ByVal myArray() As String)
....
End Sub

And I am calling it this way:
MyFunction("hello", {"ola", "hola", "hello"})

I am having problems in passing the array,
What am I doing wrong?

Thanks,
Miguel

Nov 19 '05 #1
1 1314
Instead, use:
MyFunction("hello", New String() {"ola", "hola", "hello"})

David Anton
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# converter
and the Instant VB C# to VB.NET converter

"Shapper" wrote:
Hello,

I have this function:

Sub MyFunction(ByVal myString As String, ByVal myArray() As String)
....
End Sub

And I am calling it this way:
MyFunction("hello", {"ola", "hola", "hello"})

I am having problems in passing the array,
What am I doing wrong?

Thanks,
Miguel

Nov 19 '05 #2

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

Similar topics

6
9249
by: Randell D. | last post by:
Folks, I've asked this before but never got any response but its important and I thought I'd pitch it again (hopefully a bit clearer)... One can pass data from one function to another either...
4
5905
by: The Mess | last post by:
I would like to pass a Control array of OptionButtons that I created at run time to a Sub. Say I have Opt(0), Opt(1)......Opt(5) as OptionButtons, is there a way to pass Opt to a function and...
6
1789
by: Kenny | last post by:
Hello, can anyone tell me how to pass an array to a function ? I have this function , part of my class. It works if I do not put in int a everywhere , but obviously , I need to add an array so I...
1
7652
by: Mark Dicken | last post by:
Hi All I have found the following Microsoft Technet 'Q' Article :- Q210368 -ACC2000: How to Pass an Array as an Argument to a Procedure (I've also copied and pasted the whole contents into...
7
25145
by: ritchie | last post by:
Hi all, I am new to this group and I have question that you may be able to help me with. I am trying to learn C but am currently stuck on this. First of all, I have a function for each sort...
4
2255
by: =?Utf-8?B?bmlja25hbWU=?= | last post by:
I have the following xml Schema: “<?xml version="1.0" encoding="Windows-1252"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"...
14
20363
by: Abhi | last post by:
I wrote a function foo(int arr) and its prototype is declared as foo(int arr); I modify the values of the array in the function and the values are getting modified in the main array which is...
24
55005
by: =?Utf-8?B?U3dhcHB5?= | last post by:
Can anyone suggest me to pass more parameters other than two parameter for events like the following? Event: Onbutton_click(object sender, EventArgs e)" Event handler: button.Click += new...
9
30044
by: nicnac | last post by:
Hi, I'm self learning javascript - so any pointers are welcomed!! I have an issue passing a form and array from one function to another. I tried many variations ! I can't get this to work...
0
7055
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
6920
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
7106
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...
1
6760
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...
0
5365
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,...
0
4501
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3013
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...
0
3004
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.