Jump to content

[SOLVED]Get listview clicked & make array


caleb41610
 Share

Recommended Posts

$serverlist = GUICtrlCreateListView( "#|User Name|IP Address|Operating System|Office version|Administrator|In AD", 255, 5, 535, 370 )
$test1 = GUICtrlCreateListViewItem( "1|PC-1|192.168.0.2|Windows 7|2003|Yes|No", $serverlist )
$test2 = GUICtrlCreateListViewItem( "2|PC-2|192.168.0.3|Windows XP|2003|No|Yes", $serverlist )
$button = GUICtrlCreateButton( "test", 5, 5, 50, 50 )



While 1
$msg = GUIGetMsg( )
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $button
makearray( $selected )
EndSelect
WEnd


Func makearray( $selected )
; ??
EndFunc

How would I parse the selected one in to an array like this?

$array[1][1] = "1"

$array[1][2] = "Caleb"

etc.

I'm going to make a script to keep 23 office computers in line and tell me which ones need updating. I have most of the rest finished but for some reason this part has me stuck. I wrote an example snipped above .

Edited by caleb41610
Link to comment
Share on other sites

Take a look at the helpfile for the GUICtrlCreateListViewItem() function.

The example states that somthing similar to this:

GUICtrlRead(GUICtrlRead($listview))

will return the contents of the actual selected item.

Use StringSplit() to get the line into an array.

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
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...