Sign in to follow this  
Followers 0
Skrip

Alphebet-ization

4 posts in this topic

I have no clue how this would work.

A gui would appear then, you click 'Add Word' then a msgbox appears then you input a word or 2 (first-last name) you'd click Alphebetize then it would alphebetize them, then place them in a file alphebetized.

I have no idea how anybody would do this.

Can somebody give it a shot?


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites



There was a thread with something almost exactly like this, very recently. A search on the forum for "Alphabetize" might turn it up.

-mu

Share this post


Link to post
Share on other sites

Hmm I did before while nothing came up. I'll do it again.


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

Hmm I did before while nothing came up. I'll do it again.

I wrote this script before, heres code

;---Include---
#Include <GUIConstants.au3>
#Include <Array.au3>
;==

;---Variables---
Global $Button_[4], $Label_[5], $Edit_[2], $Combo_[1], $text
;==

;---Build GUI---

$win1 = GUICreate("Alphabetizer", 400, 585, -1, -1, BitOr($WS_EX_TOPMOST, $WS_EX_APPWINDOW))
GUISetBkColor("0xCCCCCC")
$Combo = GUICtrlCreateCombo ("A-Z", 275,50, 75, 50, -1)
    GUICtrlSetData(-1,"Z-A")
$Label_[0] = GUICtrlCreateLabel("Order to sort:", 200, 50, 75, 20, -1) 
$Label_[1] = GUICtrlCreateLabel("Alphabetizer", 10, 10, 185, 40, -1) 
    GUICtrlSetFont (-1,20, 600, 6, "Veranda")
$Edit_[0] = GUICtrlCreateEdit("Use a "","" to separate words.", 10, 125, 175, 350)
$Label_[2] = GUICtrlCreateLabel("Input:", 10, 100, 75, 15, -1)
$Edit_[1] = GUICtrlCreateEdit("", 210, 125, 175, 350)
$Label_[3] = GUICtrlCreateLabel("Result:", 210, 100, 75, 15, -1)
$Button_[0] = GUICtrlCreateButton("Sort", 100, 500, 75, 40, -1)
$Button_[1] = GUICtrlCreateButton("Cancel", 225, 500, 75, 40, -1)
$Button_[2] = GUICtrlCreateButton("Clear", 285, 100, 75, 20, -1)
$Button_[3] = GUICtrlCreateButton("Clear", 85, 100, 75, 20, -1)
$Label_[4] = GUICtrlCreateLabel("By: Paulie", 50, 60, 75, 20, -1)
GUICtrlSetFont (-1,9, 400, 2, "Veranda")
GUISetState()

While 1
    $msg = GUIGetMsg()
   
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $Button_[1] then ExitLoop
    If $msg = $Button_[0] then 
    $Combo1 = GuiCtrlRead($combo)
    If $Combo1 = "A-Z" then
    SortAsc()
    Else
    SortDes()
    Endif
    Endif
    If $msg = $Button_[2] then
    GUICtrlSetData($Edit_[1], "","")
    EndiF
    If $msg = $Button_[3] then
    GUICtrlSetData($Edit_[0], "","")
    EndiF
Wend

Func Sortasc()
$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

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

:)

Share this post


Link to post
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
Sign in to follow this  
Followers 0