Passing an Array

  • Thread starter Thread starter Thomas Beyerlein
  • Start date Start date
T

Thomas Beyerlein

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(pfinfo)
f.show()
Me.Close()

NEW FORM:

Public sub new(byref p as string)
mybase.new
initializecomponent()

Dim PFINFO() as string
PFINFO = P
end sub

Any help would be great

Tom
 
Thomas Beyerlein said:
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(pfinfo)
f.show()
Me.Close()

NEW FORM:

Public sub new(byref p as string)
mybase.new
initializecomponent()

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.
 
Thomas Beyerlein said:
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(pfinfo)
f.show()
Me.Close()

NEW FORM:

Public sub new(byref p as string)

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top