View Single Post
 
Old 09-01-2017, 10:35 AM
skyfox's Avatar
skyfox skyfox is offline
Centurion
 
Join Date: Feb 2005
Location: InsideACircularReference
Posts: 190
Default Get data in to an array without defined elements. How?

Hopefully the title wasn't too confusing as my terminology may be off. The following statement, takes contents of a textbox with comma seperated values and puts them in to a string array called my values.

textbox1. text contains.... "1,2,3,4,5,6" etc. (all numeric values)

Code:
 Dim MyValues As String() = textBox1.Text.Split(New Char() {","c})
What I want to do is, instead of comma seperated values from a text box, I want to get content of a string array (all elements) in to MYValues() from above.

So I have;
Code:
Dim MyStrings(25) as string
What is the proper syntax to get the values in "MyStrings(25)" put in to "MyValues()"?

I could loop thru "MyStrings" array and create a resulting string with comma separated values and then use the split function to load the data in to "Myvalues" like the example above. But that seems like several unnecessary steps. Just in case if anyone is wondering "Myvalues" is sent to a device via serial communications. So I am guessing it is a type of character array of some sort.

Thanks!
__________________
SkyFox
Tinker of All, Master of NONE!
"To B or Not To VB? That's the Question"

Last edited by skyfox; 09-01-2017 at 01:28 PM.
Reply With Quote