#include #include #include #include #include "GUIListViewEx.au3" global $str = "" _ &"*Fungal Diseases,*Black Spot,*Control1,*Control2,,,,,"&@crlf _ &",Warm, wet weather,destroy leaves,,,,,,"&@crlf _ &",watery leaves,Avoid watering.,,,,,,"&@crlf _ &",black spots,Avoid shady ,,,,,,"&@crlf _ &",,improve pH,,,,,,"&@crlf _ &",*Powdery Mildew,*Control,,,,,,"&@crlf _ &",whitish coating,sprayed preventatively,,,,,,"&@crlf _ &",temp 80F,,,,,,,"&@crlf _ &",humidity 97%,,,,,,,"&@crlf _ &",,,,,,,,"&@crlf _ &",*Stem Cankers ,*control,,,,,,"&@crlf _ &",improper pruning,fungicide spray,,,,,,"&@crlf _ &",,Prune out,,,,,,"&@crlf _ &",,1/4 inch bud ,,,,,,"&@crlf _ &",,slanted away,,,,,,"&@crlf _ &",,,,,,,,"&@crlf _ &"*Roses resist spot,*Cultivar ,*Type, Height,Color, Fragrant,,,"&@crlf _ &",Pink Peace , Hybrid , 3 to 4,pink, Very fragrant,,,"&@crlf _ &",Tiffany, Tea,4 to 5,lpink,Yes,,,"&@crlf _ &",Tropicana,HT,5 to 6,red,OK fragrant,,,"&@crlf _ &",,,,,,,,"&@crlf _ &"*Rose Virus ,Mosaic Virus,Control,,,Rose Rosette,Control"&@crlf _ &",through grafting,aphids leafhoppers,,,multiflora,horti oil"&@crlf _ &",,Control weeds,,,veget shoots,insect soap"&@crlf _ &",,,,,crinkled Leaves,Remove plant"&@crlf _ &",,,,,wingless mite,"&@crlf _ &",,,,,reddish excess thorny  ,"&@crlf _ &",,,,,Witches-broom,,," #Region ### START Koda GUI section ### Form=C:\Users\hg\Desktop\old autoit\koda\Forms\rose.kxf $Form1 = GUICreate("AForm1", 1201, 800, 193, 115) $Button1 = GUICtrlCreateButton("Rose ", 32, 16, 75, 25, 0) $btest = GUICtrlCreateButton("Dahliah", 128, 16, 75, 25, 0) $btest1 = GUICtrlCreateButton("Peony", 216, 16, 75, 25, 0) $btest2 = GUICtrlCreateButton("String2Array", 304, 16, 75, 25, 0) $Input1 = GUICtrlCreateInput("AInput1", 400, 16, 321, 21) $Label1 = GUICtrlCreateLabel("ALabel1", 752, 16, 139, 17) $iLVx = 40 $iLVy = 80 $idLV = GUICtrlCreateListView("", $iLVx, $iLVy, 1100, 700);"text", left, top [, width [, height GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btest2 $a2d = s2l($str) dellist() ;delete old listview makelist($a2d) ;x2n($a2d) ; display string on notepad EndSwitch WEnd func x2n(byref $qa) local $stro = "" FileOpen(@desktopdir &"\wenote.txt", 2) for $a = 0 to UBound($qa) - 1 for $b = 0 to UBound($qa,2) - 1 ;$str &= $qa[$a][$b] &@tab &@tab &@tab $stro &= StringFormat("%-" &"20" &"s", $qa[$a][$b]) ; $str &= $qa[$a][$b] &@TAB &@TAB Next $stro &= @crlf Next ;ConsoleWrite($stro) FileWrite(@desktopdir &"\wenote.txt", $stro) ShellExecute("notepad", @desktopdir &"\wenote.txt") EndFunc func makelist(byref $qa) $lvI = _GUIListViewEx_Init($idLV, $qa, 0, 0, False, 512) _GUICtrlListView_SetItemCount($idLV, UBound($qa));+100) ;set how many rows for $c = 0 to UBound($qa,2) - 1 $width = 20 _GUICtrlListView_AddColumn($idLV, $qa[1][$c], $width * 8 ) ;create column header Next _GUICtrlListView_AddArray($idLV, $qa) _GUIListViewEx_SetColour($lvI, "0x00FF00", 1, 1) EndFunc func s2l(byref $str) ;string 2 array local $tcol = 10 ; lazy assign the column for listview or the 2D array obtaining from the string $a = StringSplit($str, @CRLF,$STR_NOCOUNT) if not IsArray($a) then ConsoleWrite( "No row for table" &@CRlf) return false EndIf ;_ArrayDisplay($a) ;Exit local $table[UBound($a)][$tcol] for $r = 0 to UBound($a)- 1 $la = StringSplit($a[$r],",",$STR_NOCOUNT) ;split the row to column ;ConsoleWrite(" # rows of table " &$r &UBound($la) &@crlf) for $c = 0 to UBound($la) - 1 $table[$r][$c] = $la[$c] Next Next ;_ArrayDisplay($table) return $table ;makelist($table) EndFunc func dellist() $cc = _GUICtrlListView_GetColumnCount($idLV) ;ConsoleWrite( $cc & " beging of cc " &@crlf) if $cc > 0 then _GUICtrlListView_DeleteAllItems($idLV) do $cc = _GUICtrlListView_GetColumnCount($idLV) ;ConsoleWrite($cc &" colums" &@crlf) for $i = 0 to $cc _GUICtrlListView_DeleteColumn ( $idLV, $i) Next Until $cc = 0 EndIf EndFunc