Dampe Posted March 19, 2008 Share Posted March 19, 2008 This writes to array Is there anyway to convert the array to string using _Arraytostring? I can't seem to get it to work. Thanks. Link to comment Share on other sites More sharing options...
DarkMatter Posted March 19, 2008 Share Posted March 19, 2008 The _ArrayToString function only supports one dimensional arrays. ProcessList() Returns a two dimensional array. You could do this to get the same result as _ArrayToString: Dim $ProcessArray Dim $ProcessString Dim $i $ProcessArray = ProcessList() For $i = 1 to UBound($ProcessArray) - 1 $ProcessString = $ProcessString & "|" & $ProcessArray[$i][0] Next [sub]Quantum mechanics: The dreams stuff is made of[/sub] Link to comment Share on other sites More sharing options...
weaponx Posted March 19, 2008 Share Posted March 19, 2008 (edited) Which part of it do you want in a string? The PID or the process name? $myString = "" $myArray = ProcessList () For $X = 1 to $myArray[0][0] ;Write process names to string seperated by semicolon $myString &= $myArray[$X][0] & ";" ;Write process pids to string seperated by semicolon ;$myString &= $myArray[$X][1] & ";" Next MsgBox(0,"",$myString) EDIT: You get the idea Edited March 19, 2008 by weaponx Link to comment Share on other sites More sharing options...
Kip Posted March 19, 2008 Share Posted March 19, 2008 $myString = "" $myArray = ProcessList () For $X = 1 to $myArray[0][0] ;Write process names to string seperated by semicolon $myString &= $myArray[$X][0] & ";" ;Write process pids to string seperated by semicolon ;$myString &= $myArray[$X][0] & ";" Next MsgBox(0,"",$myString) the second $myArray[$X][0] should be $myArray[$X][1] MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now