Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

how to put string into array?

hi all, after some processed, i would like to put a string into array seems i want to reuse it back in another page. can anyone show me how to do that?
this is the code example:

If max_num = prob_ALL_no Then
display = " <=50K."
Else
display = " >50K."
End If

<want to put 'display' into array>

thanks~
[395 byte] By [izza_azhar] at [2007-11-11 8:16:53]
# 1 Re: how to put string into array?
Since you mention a page, I assume you're using ASP.NET, is that correct? If so, you can store the value in the Session variable and recall it from any page:

If max_num = prob_ALL_no Then
Session("display") = " <=50K."
Else
Session("display") = " >50K."
End If

Then, to recall the value on another page:

display = Session("display")
Phil Weber at 2007-11-11 21:47:46 >
# 2 Re: how to put string into array?
Since you mention a page, I assume you're using ASP.NET, is that correct? If so, you can store the value in the Session variable and recall it from any page:

If max_num = prob_ALL_no Then
Session("display") = " <=50K."
Else
Session("display") = " >50K."
End If

Then, to recall the value on another page:

display = Session("display")

opss. sorry, i'm not using the asp.net.actually want to send it to another form in vb.net.
can u show me how to do that?
thanks~
izza_azhar at 2007-11-11 21:48:44 >
# 3 Re: how to put string into array?
salam, declare a public variable on the form where you want to use this value
then declare an instance of that form and set the variable value as:

dim Frm as new frmTest

Frm.TestVariable=display

Frm.Show()

now you can use the TestVariable value on Frm.
Thats it.

Muhammad Ali
sequel at 2007-11-11 21:49:49 >
# 4 Re: how to put string into array?
salam, declare a public variable on the form where you want to use this value
then declare an instance of that form and set the variable value as:

dim Frm as new frmTest

Frm.TestVariable=display

Frm.Show()

now you can use the TestVariable value on Frm.
Thats it.

Muhammad Ali
got it.. thanks all~~
izza_azhar at 2007-11-11 21:50:49 >