Sign in to follow this  
Followers 0
Dampe

ProcessList()

4 posts in this topic

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.


Share this post


Link to post
Share on other sites



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]

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by weaponx

Share this post


Link to post
Share on other sites

$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] :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0