Page 1 of 1

two command in single line

Posted: 21 Jul 2018, 07:20
by MonuKashyap
I wish to add two ahk command in single line.
like

loop
{
if a_index=100
Break && Return ;<<<<<<<this
else
tooltip % a_index
}

Re: two command in single line

Posted: 21 Jul 2018, 07:51
by swagfag
this doesnt even make any sense.
what do u imagine the statement Break and Return should do? Break out of the loop, then return out of the function? Thats what Return by itself already does.

Code: Select all

if A_Index = 100
{
break
return ; unreachable code
}
break and return are mutually exclusive in this context, as are most other control flow statements... probably.

Re: two command in single line

Posted: 07 Dec 2021, 00:40
by MonuKashyap
swagfag wrote:
21 Jul 2018, 07:51
this doesnt even make any sense.
what do u imagine the statement Break and Return should do? Break out of the loop, then return out of the function? Thats what Return by itself already does.

Code: Select all

if A_Index = 100
{
break
return ; unreachable code
}
break and return are mutually exclusive in this context, as are most other control flow statements... probably.
Yes you R right,,
actually, at that time i m very newbie in ahk

Thanks