No matching if Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Wolfmas

No matching if  Topic is solved

20 Jun 2018, 11:50

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

 Try:
PixelSearch, Px, Py, 811, 334, 811, 334, 0x414cde, 1, Fast
if ErrorLevel
{ Var1:=(Var1+1)
Goto, Check }
Else
{ Var2:=(Var2+1)
Goto, Check }
return


Getting No matching if error whats wrong?
Hellbent
Posts: 142
Joined: 23 Sep 2017, 13:34

Re: No matching if

20 Jun 2018, 12:00

Wolfmas wrote:

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

 Try:
PixelSearch, Px, Py, 811, 334, 811, 334, 0x414cde, 1, Fast
if ErrorLevel
{ Var1:=(Var1+1)
Goto, Check }
Else
{ Var2:=(Var2+1)
Goto, Check }
return


Getting No matching if error whats wrong?


Braces Were set up wrong.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

JoeWinograd
Posts: 970
Joined: 10 Feb 2014, 20:00

Re: No matching if

20 Jun 2018, 12:04

Incorrect use of braces. Read the doc here:
https://autohotkey.com/docs/commands/Block.htm

One form of correct syntax is this:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


But since both paths do a Goto, Check, you could do this instead:

Code: [Select all] [Download] GeSHi © Codebox Plus

if ErrorLevel
Var1:=(Var1+1)
Else
Var2:=(Var2+1)
Goto, Check

Regards, Joe

Return to “Ask For Help”

Who is online

Users browsing this forum: newbieforever, whynotregister and 47 guests