help in a variable for various labels

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
bittencourt318
Posts: 90
Joined: 16 Apr 2020, 10:57

help in a variable for various labels

09 Mar 2022, 19:56

how can I do to use a variable to be able to decrease the size of the script already tried to use

Code: Select all

abc := ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33"]
but it didn't work!

this is the labels i'm trying to shrink

Code: Select all

1:
return
2:
return
3:
return
4:
return
5:
return
6:
return
7:
return
8:
return
9:
return
10:
return
11:
return
12:
return
13:
return
14:
return
15:
return
16:
return
17:
return
18:
return
19:
return
20:
return
21:
return
22:
return
23:
return
24:
return
25:
return
26:
return
27:
return
28:
return
29:
return
30:
return
31:
return
32:
return
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: help in a variable for various labels

09 Mar 2022, 20:55

These are just regular subroutine labels, so the exercise seems pointless. What is the end goal? Why would so many different labels be needed for the same routine? Why would the subroutines do nothing?
bittencourt318
Posts: 90
Joined: 16 Apr 2020, 10:57

Re: help in a variable for various labels

09 Mar 2022, 21:04

mikeyww wrote:
09 Mar 2022, 20:55
These are just regular subroutine labels, so the exercise seems pointless. What is the end goal? Why would so many different labels be needed for the same routine? Why would the subroutines do nothing?
was the way I found not to give error because the script has 32 lines if I use for example 10 lines next to the error because it has no value in the variable
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: help in a variable for various labels

09 Mar 2022, 21:05

If you need help with a script, I think it's best to post it. I have no understanding of what you are trying to accomplish with your script.

Labels can be stacked, but aside from AHK's special GUI labels, there is not always a need for multiple labels because you can just use one label instead. In some situations, the stacking is useful.

Code: Select all

Gui, Font, s10
Gui, Add, Button, w250, 1
Gui, Add, Button, wp  , 2
Gui, Show
Return
Button1:
Button2:
MsgBox, 64, This label, %A_ThisLabel%
Return
But:

Code: Select all

Gui, Font, s10
Gui, Add, Button, w250 g1, 1
Gui, Add, Button, wp   g1, 2
Gui, Show
Return
1:
MsgBox, 64, GUI control, %A_GuiControl%
Return
Or:

Code: Select all

Gui, Font, s10
Loop, 5
 Gui, Add, Button, w250 gButton, %A_Index%
Gui, Show
Return
Button:
MsgBox, 64, GUI control, %A_GuiControl%
Return
See?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], macromint, peter_ahk, Rauvagol, Spawnova, wineguy and 290 guests