Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +q::
- Gui, Counter:New,, CharacterCounter
- Gui, Add, Edit, x10 y10 w210 h350 vEditInput
- Gui, Add, Edit, x272 y10 w210 h350 vOutput
- Gui, Add, Button, x222 y160 w50 h70 gcnt, --->
- Gui, Show, w499 h379,
- return
- cnt:
- data := []
- Gui, Submit, NoHide
- ;remove deadspace and format for ease of use
- StringReplace, EditInput, EditInput, %A_SPACE%,, All
- StringReplace, EditInput, EditInput, %A_Tab%,, All
- StringReplace, EditInput, EditInput, _,, All
- StringReplace, EditInput, EditInput, #,, All
- StringReplace, EditInput, EditInput, QTY,%A_Space%, All
- StringReplace, EditInput, EditInput, x,%A_Space%, All
- lines := StrSplit(EditInput,"`n") ;get lines
- for k, line in lines
- {
- div := StrSplit(line,A_Space)
- txt := div[1]
- val := div[2]
- loop % StrLen(txt)
- {
- char := SubStr(txt,A_Index,1)
- if data[char] is number
- {
- data[char] += val
- }
- else
- {
- data[char] := val
- }
- }
- }
- str =
- for k, dat in data
- str .= "`'" . k . "`'" . " = " . dat . "`n"
- GuiControl,, Output, %str%
- return
- GuiClose:
- gui, Destroy
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement