how to put string into array?

izza_azhar

Member
Joined
Mar 1, 2006
Messages
17
Programming Experience
Beginner
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~
 
Maybe you should be a little more clear on your question.

Is this what you mean?
[FONT=&quot] Public Shared an_array() As String[/FONT]

[FONT=&quot] Public Sub add_array()[/FONT]
[FONT=&quot] If max_num = prob_ALL_no Then[/FONT]
[FONT=&quot] display = " <=50K."[/FONT]
[FONT=&quot] Else[/FONT]
[FONT=&quot] display = " >50K."[/FONT]
[FONT=&quot] End If[/FONT]

[FONT=&quot] an_array(1) = display[/FONT]
[FONT=&quot] End Sub[/FONT]
 
i think he wants the " <=50K." stored in a string array[FONT=&quot]
[/FONT]but we need more info because from the code sample it's stupid to store a single value in an array
 
JuggaloBrotha said:
i think he wants the " <=50K." stored in a string array[FONT=&quot]
[/FONT]but we need more info because from the code sample it's stupid to store a single value in an array

yes, actully, i want to store the string into the array..
then how to write the array into the list box?
besides, how can i reuse the array in another form?
can u show me?
thanks alot for ur help~
 
simply declare the Array as Friend or Public and you can access it on all the form's in the application

to add the array to a listbox use: Listbox1.Items.AddRange(YourArray)
 
Back
Top