Jump to content

PlayHD

Active Members
  • Posts

    148
  • Joined

  • Last visited

Community Answers

  1. PlayHD's post in Read value from ListView on mouse click was marked as the answer   
    Something like this ?
    #include <GuiConstantsEx.au3> #include <File.au3> #include <Array.au3> #include <ListviewConstants.au3> #include <GuiListView.au3> Local $FileList ;declare variables here, not in a loop Local $DataReadFromList $GUI = GUICreate("Automation", 300, 500) ;is good to save the window handle $mylist = GUICtrlCreateList("", 10, 60, 280, 100) $add = GUICtrlCreateButton("Add", 10, 35, 75, 20) GUISetState(@SW_SHOW,$GUI) ;;;; While 1 $msg = GUIGetMsg() Switch $msg Case $add _FileReadToArray("C:\Users\Danny Tan\Desktop\test.txt", $FileList) If @error Then ContinueLoop ;if file not found do something (else the program will generate error) For $i = 1 To $FileList[0] GUICtrlSetData($mylist, $FileList[$i]) Next Case $mylist ;if select a item from list do stuff $DataReadFromList = GUICtrlRead($mylist) MsgBox(0,0,$DataReadFromList) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd
  2. PlayHD's post in Multiline file to array was marked as the answer   
    #include <array.au3> $file = FileOpen("data.txt") $text = FileRead($file) $array = StringSplit($text,"|") _ArrayDelete($array,0) _ArrayDisplay($array)
×
×
  • Create New...