Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Arrays

Status
Not open for further replies.

claforet

Mechanical
Joined
Apr 8, 2010
Messages
54
Location
US
Does anyone know a command to convert a string array to a single string (I am passing the file path to the run_journal.exe program and I need to make the array of strings into a single string).

Thanks.
 
What language?
Some pseudocode might be something like this?

Code:
superstring = ""
for i = 0 to ubound(strarray)
superstring = superstring & strarray(i)
next
 
If you are talking tcl which if you are in UGS you might be, you could try something like this. This does work, you will get a long string, but the order in which it appends is somewhat hazy. So if the order in which the variables are added to the string, this should work.

foreach {index value} [array get myarray] {
if {![info exists stringvar]} {
set stringvar $value
} else {
append stringvar $value
}
} ;# foreach
 
Sorry didn't notice that you said it was a path so order would be important.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top