Jump to content

Topic Title


Recommended Posts

how would i list a group of numbers from low to high. and not knowing the numbers.

like in:

ProcessList()

Processlist returns an array you have to iterate through to

if $pl = Processlist(), then Dim $pl_sorted[$pl[0]+1][2] and iterate using your favorite sorting algorithm.

There are also a bunch of _Array* UDFs that you may wish to investigate.

Or slap it into one of the gui controls that sorts by default, then read the results back out sorted for you.

i.e.

$pl = ProcessList()
for $i = 1 to $pl[0][0]
;append $pl[$i][0] to listbox for names
;append $pl[$i][1] to add pids
;these would be guictrlsetdata() calls ?  -don't have the gui stuff on the top of my head
next
; get datacontrol contents - guictrlgetdata() ?
Edited by flyingboz

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

how would i list a group of numbers from low to high. and not knowing the numbers.

like in:

ProcessList()

Actually I don't understand the problem. I can only guess: Use an array and loop through it or use _ArrayDisplay(). If you want to list them from low to high, you'll have to sort the array.

#include <Array.au3>

Dim $avArray[5]
$avArray[0] = 8
$avArray[1] = 39
$avArray[2] = 1
$avArray[3] = 18
$avArray[4] = 22

_ArrayDisplay( $avArray, "Unsorted" )
_ArraySort( $avArray)
_ArrayDisplay( $avArray, "Sort Ascending" )

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Actually I don't understand the problem. I can only guess: Use an array and loop through it or use _ArrayDisplay(). If you want to list them from low to high, you'll have to sort the array.

#include <Array.au3>

Dim $avArray[5]
$avArray[0] = 8
$avArray[1] = 39
$avArray[2] = 1
$avArray[3] = 18
$avArray[4] = 22

_ArrayDisplay( $avArray, "Unsorted" )
_ArraySort( $avArray)
_ArrayDisplay( $avArray, "Sort Ascending" )

Cheers

Kurt

THE ARRAY THAT IS RETURNED BY PROCESSLIST IS TWO DIMENSIONAL

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

THE ARRAY THAT IS RETURNED BY PROCESSLIST IS TWO DIMENSIONAL

@Valuater

So you've said repeatedly AND LOUDLY. It's just a variable. Please GET A NEW KEYBOARD, yours ONLY TYPES L337 and ALL CAPS.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...