order of function

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
abtn13857
Posts: 1
Joined: 03 Mar 2017, 23:45

order of function

23 Mar 2017, 00:52

Gui, Add, Edit, x12 y49 w100 h20 vone, 2
Gui, Add, Edit, x12 y79 w100 h20 vtwo, 1
Gui, Add, Edit, x12 y109 w100 h20 vthree, 3
Gui, Add, Edit, x12 y139 w100 h20 vfour, 5
Gui, Add, Edit, x12 y169 w100 h20 vfive, 4

gui, show, w304 h417, AUTO
gui, submit, nohide

F1::

A:
{
msgbox, %one%
}

B:
{
msgbox, %two%
}

C:
{
msgbox, %three%
}

D:
{
msgbox, %four%
}

F:
{
msgbox, %five%
}

return



I made that simple script for asking you guys.


if I run this program now, it open msgboxs by order 2 and 1 and 3 and 5 and 4

but I want this order like 5 and 4 and 3 and 2 and 1

in other words, descending order.

I mean whole labels order.


How run that labels according to descending order?
A_AhkUser
Posts: 1147
Joined: 06 Mar 2017, 16:18
Location: France
Contact:

Re: order of function

24 Mar 2017, 21:21

Code: Select all

Gui, Add, Edit, x12 y49 w100 h20 ve1, 2
Gui, Add, Edit, x12 y79 w100 h20 ve2, 1
Gui, Add, Edit, x12 y109 w100 h20 ve3, 3
Gui, Add, Edit, x12 y139 w100 h20 ve4, 5
Gui, Add, Edit, x12 y169 w100 h20 ve5, 4
gui, show, w304 h417, AUTO
gui, submit, nohide
F1::
o := {} ; create an object i.e.: Object := {KeyA: ValueA, KeyB: ValueB, ..., KeyZ: ValueZ}
Loop, 5
o[e%a_index%] := "e" . a_index ; so we have an object like this o := {1:"e1", 3:"e2", 4:"e5",...}
Loop, 5
Gosub % o[a_index] ; lunch each subroutine depending on value of key (index) we are currently looping through the object...
return
e1:
MsgBox, e1
return
e2:
MsgBox, e2
return
e3:
MsgBox, e3
return
e4:
MsgBox, e4
return
e5:
MsgBox, e5
return
I don't know if it's exactly what you are aiming for. Hope it helps you.
my scripts

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada and 297 guests