Jump to content

Alphabetizer


Recommended Posts

I am writing a program that will alphabetize a set of words for you, (I often do this at work, so this would make it easier) So after browsing, I foun "ArraySort()" now for some reason, my GUI for this is not working, when I push the sort button, nothing happens

Why

CODE

;---Include---

#Include <GUIConstants.au3>

#Include <Array.au3>

;==

;---Variables---

Global $Button_[2], $Label_[4], $Edit_[2], $Combo_[1], $Result

;==

;---Build GUI---

$win1 = GUICreate("Alphabetizer", 700, 700, -1, -1, BitOr($WS_EX_TOPMOST, $WS_EX_APPWINDOW))

$Combo = GUICtrlCreateCombo ("A-Z", 600,50, 75, 50, -1)

GUICtrlSetData(-1,"Z-A")

$Label_[0] = GUICtrlCreateLabel("Order to sort:", 525, 50, 75, 50, -1)

$Label_[1] = GUICtrlCreateLabel("Alphabetizer", 50, 50, 400, 100, -1)

GUICtrlSetFont (-1,40, 600, 6, "Veranda")

$Edit_[0] = GUICtrlCreateEdit("Use a "","" to separate words.", 50, 300, 225, 350)

$Label_[2] = GUICtrlCreateLabel("Input:", 50, 260, 75, 40, -1)

$Edit_[1] = GUICtrlCreateEdit("", 280, 300, 225, 350)

$Label_[3] = GUICtrlCreateLabel("Result:", 280, 260, 75, 40, -1)

$Button_[0] = GUICtrlCreateButton("Sort", 550, 400, 75, 40, -1)

$Button_[1] = GUICtrlCreateButton("Cancel", 550, 465, 75, 40, -1)

GUISetState()

;==

;---Display---

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

If $msg = $Button_[1] then ExitLoop

If $msg = $Button_[0] then Sort()

Wend

;==

;---Functions---

Func Sort()

$read1 = GUICtrlRead($Edit_[0])

$read2 = Stringsplit($read1, ",")

_ArraySort( $read2)

GUICtrlSetData($Edit_[1], $read2)

EndFunc

;==

Link to comment
Share on other sites

;---Functions---
Func Sort()
$read1 = GUICtrlRead($Edit_[0])
$read2 = Stringsplit($read1, ",")
_ArraySort( $read2, 0, 1)
for $x = 1 to $read2[0]
GUICtrlSetData($Edit_[1], $read2[$x] & @CRLF, 2)
Next
EndFunc

8)

Val, did you know you are a genious?

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...