473,785 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing an Array


Hello,
I am trying to build a UI and I need the user to go though about 4 forms
making decisions and then passing the decision to the next form. Finally
on the last form I need all the answers to open the next and final form,
which there are 16 different ways to go. So I thought by putting the
decisions in an array, and passing it to each form. I get this error-:
Value of type '1-dimensional array of String' cannot be converted to
'String'.

Here is an example of my code:

dim PFINFO() as string
BTNCLICK EVENT

PFINFO(0) = "F"
Dim f As New frmchooseType(p finfo)
f.show()
Me.Close()

NEW FORM:

Public sub new(byref p as string)
mybase.new
initializecompo nent()

Dim PFINFO() as string
PFINFO = P
end sub

Any help would be great

Tom

*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #1
2 1303

"Thomas Beyerlein" <tb***@yahoo.co m> wrote in message
news:e2******** ******@TK2MSFTN GP10.phx.gbl...

Hello,
I am trying to build a UI and I need the user to go though about 4 forms
making decisions and then passing the decision to the next form. Finally
on the last form I need all the answers to open the next and final form,
which there are 16 different ways to go. So I thought by putting the
decisions in an array, and passing it to each form. I get this error-:
Value of type '1-dimensional array of String' cannot be converted to
'String'.

Here is an example of my code:

dim PFINFO() as string
BTNCLICK EVENT

PFINFO(0) = "F"
Dim f As New frmchooseType(p finfo)
f.show()
Me.Close()

NEW FORM:

Public sub new(byref p as string)
mybase.new
initializecompo nent()

Dim PFINFO() as string
PFINFO = P
end sub

Any help would be great

Tom

You told it in the new that you wanted a string parameter rather than a
string() parameter. It is telling you that it cannot convert a string array
to a string.
Nov 21 '05 #2
"Thomas Beyerlein" <tb***@yahoo.co m> schrieb:
So I thought by putting the
decisions in an array, and passing it to each form. I get this error-:
Value of type '1-dimensional array of String' cannot be converted to
'String'.

Here is an example of my code:

dim PFINFO() as string
BTNCLICK EVENT

PFINFO(0) = "F"
Dim f As New frmchooseType(p finfo)
f.show()
Me.Close()

NEW FORM:

Public sub new(byref p as string)


=> '...(ByVal p() As String)'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3

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

Similar topics

8
3969
by: Alex Vinokur | last post by:
Various forms of argument passing ================================= C/C++ Performance Tests ======================= Using C/C++ Program Perfometer http://sourceforge.net/projects/cpp-perfometer http://alexvn.freeservers.com/s1/perfometer.html
15
4686
by: Dave | last post by:
I'm currently working on a small project (admitedly for my CS class) that compares the time difference between passing by value and passing by reference. I'm passing an array of 50000 int's. However, since in C++ an array is passed by reference by default I need to embed the array into a struct in order to pass it by value. The problem is that I get a segmentation error when doing so. I'm using the Dev-c++ compiler. Any ideas? ...
58
10181
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 code... TCHAR myArray; DoStuff(myArray);
9
4808
by: justanotherguy63 | last post by:
Hi, I am designing an application where to preserve the hierachy and for code substitability, I need to pass an array of derived class object in place of an array of base class object. Since I am using vector class(STL), the compiler does not allow me to do this. I do realize there is a pitfall in this approach(size of arrays not matching etc), but I wonder how to get around this problem. I have a class hierachy with abstract base...
8
4117
by: kalinga1234 | last post by:
there is a problem regarding passing array of characters to another function(without using structures,pointer etc,).can anybody help me to solve the problem.
10
3172
by: Pete | last post by:
Can someone please help, I'm trying to pass an array to a function, do some operation on that array, then return it for further use. The errors I am getting for the following code are, differences in levels of indirection, so I feel it must have something to do with the way I am representing the array in the call and the return. Below I have commented the problem parts. Thanks in advance for any help offered. Pete
6
12660
by: DeepaK K C | last post by:
Could anybody tell me how to pass array to a function by value? -Deepak
11
8131
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 number) which is the last line of the following sub routine: ' procedure modifies elements of array and assigns ' new reference (note ByVal) Sub FirstDouble(ByVal array As Integer()) Dim i As Integer
8
3504
by: S. | last post by:
Hi all, Can someone please help me with this? I have the following struct: typedef struct { char *name; int age; } Student;
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10357
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9959
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6744
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.