#include #include #include #include #include #include #include #include #include #include #include #include #Region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Form1", 259, 216, -1, -1) Global $Edit1 = GUICtrlCreateEdit("", 16, 80, 225, 113, $ES_WANTRETURN + $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_MULTILINE) GUICtrlSetData(-1, "This is a Test entry!") Global $Radio1 = GUICtrlCreateRadio("ini-file", 16, 8, 113, 17) Global $Button1 = GUICtrlCreateButton("Button1", 168, 8, 75, 17) Global $Group1 = GUICtrlCreateGroup("mode selection", 16, 32, 225, 41) Global $Radio2 = GUICtrlCreateRadio("mode 1", 24, 48, 60, 17) Global $Radio3 = GUICtrlCreateRadio("mode 2", 88, 48, 60, 17) Global $Radio4 = GUICtrlCreateRadio("mode 3", 168, 48, 60, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Radio1 $file1 = "test.ini" Case $Radio2 If GUICtrlRead($Radio1) = 1 Then $m1k = IniReadSection($file1, "mode 1") $m1k = _ArrayExtract($m1k, 1, -1, 1, 1) $m1k00 = $m1k[0] $m1k01 = $m1k[1] $m1k02 = $m1k[2] $m1k03 = $m1k[3] Global $Mode1Array = [$m1k[0], $m1k[1], $m1k[2], $m1k[3]] ; Mode 1 ;Global $Mode1Array = [$m1k00, $m1k01, $m1k02, $m1k03] ; Mode 1 MsgBox(0, 0, $m1k[0] & " " & $m1k[1] & " " & $m1k[2] & " " & $m1k[3]) EndIf Case $Radio3 If GUICtrlRead($Radio1) = 1 Then $m2k = IniReadSection($file1, "mode 2") $m2k = _ArrayExtract($m2k, 1, -1, 1, 1) $m2k00 = $m2k[0] $m2k01 = $m2k[1] $m2k02 = $m2k[2] $m2k03 = $m2k[3] Global $Mode2Array = [$m2k[0], $m2k[1], $m2k[2], $m2k[3]] ; Mode 1 ;Global $Mode2Array = [$m2k00, $m2k01, $m2k02, $m2k03] ; Mode 2 MsgBox(0, 0, $m2k[0] & " " & $m2k[1] & " " & $m2k[2] & " " & $m2k[3]) EndIf Case $Radio4 If GUICtrlRead($Radio1) = 1 Then $m3k = IniReadSection($file1, "mode 3") $m3k = _ArrayExtract($m3k, 1, -1, 1, 1) $m3k00 = $m3k[0] $m3k01 = $m3k[1] $m3k02 = $m3k[2] $m3k03 = $m3k[3] Global $Mode3Array = [$m3k[0], $m3k[1], $m3k[2], $m3k[3]] ; Mode 1 ;Global $Mode3Array = [$m3k00, $m3k01, $m3k02, $m3k03] ; Mode 3 MsgBox(0, 0, $m3k[0] & " " & $m3k[1] & " " & $m3k[2] & " " & $m3k[3]) EndIf Case $Button1 $text = GUICtrlRead($Edit1) ConsoleWrite($text) $gaps = StringReplace($text, " ", "_") ConsoleWrite($gaps) GUICtrlSetData($Edit1, $gaps) $text = GUICtrlRead($Edit1) ConsoleWrite($text) $Str = $text $Arr = StringSplit($Str, "") _ArrayDisplay($Arr) $Arr[0] = "" ; ============================================================ Mode 1: If GUICtrlRead($Radio2) = 1 Then $FirstIndex = $Mode1Array Global $NewString = "" Global $a = $FirstIndex $Raws = UBound($Arr) For $i = 1 To $Raws Step 1 $a -= 1 If $a = 0 Then $a = $FirstIndex $NewString = $NewString & $Arr[$i - 1] & $Mode1Array[$a - 1] Next ; ============================================================ Mode 2: ElseIf GUICtrlRead($Radio3) = 1 Then $SecondIndex = $Mode2Array Global $NewString = "" Global $b = $SecondIndex $Raws = UBound($Arr) For $i = 1 To $Raws Step 1 $b -= 1 If $b = 0 Then $b = $SecondIndex $NewString = $NewString & $Arr[$i - 1] & $Mode2Array[$b - 1] Next ; ============================================================ Mode 3: ElseIf GUICtrlRead($Radio4) = 1 Then $ThirdIndex = $Mode3Array Global $NewString = "" Global $c = $ThirdIndex $Raws = UBound($Arr) For $i = 1 To $Raws Step 1 $c -= 1 If $c = 0 Then $c = $ThirdIndex $NewString = $NewString & $Arr[$i - 1] & $Mode3Array[$c - 1] Next EndIf If GUICtrlRead($Radio2) = 1 Then GUICtrlSetData($Edit1, $NewString) If GUICtrlRead($Radio3) = 1 Then GUICtrlSetData($Edit1, $NewString) If GUICtrlRead($Radio4) = 1 Then GUICtrlSetData($Edit1, $NewString) EndSwitch WEnd