Code: Select all
Julesverne := "hello"
;incorrect elseif syntax <- no space between else and if on line #7, which is very possibly overlooked by the author.
;with open start bracket on the same line #7 this will properly throw a compilation error
If (Julesverne = "hello"){
msgbox, % "this message should appear Example 1."
} elseif (Julesverne = "helo"){
msgbox, % "this message shouldn't appear Example 1."
}
Code: Select all
Julesverne := "hello"
;incorrect elseif <- no space between else and if on line #7, which is very possibly overlooked by the author.
;with open start bracket on the next line #8 this will not have a run time error, because it doesn't get evaluated, which would confuse the author as to why he was seeing the msgbox appear in line #9
If (Julesverne = "hello"){
msgbox, % "this message should appear Example 2."
} elseif (Julesverne = "helo")
{
msgbox, % "this message shouldn't appear Example 2."
}
The potential for this being a problem for instance may come from devs who write vbscript (like myself) where the correct syntax is ElseIf, so to me, Example 2 looks like it should work correctly. Especially when it doesn't throw an error telling me that syntax is incorrect.