Returns a non-zero number if the specified label exists in the script.
TrueOrFalse := IsLabel(LabelName)
The name of a subroutine, hotkey, or hotstring (do not include the trailing colon(s) in LabelName).
This function returns a non-zero number if LabelName exists in the script.
This function is useful to avoid runtime errors when specifying a dynamic label in functions such as Gosub, Hotkey, SetTimer and Menu.Add.
if IsLabel("Label") MsgBox "Subroutine exists" else MsgBox "Subroutine doesn't exist" Label: return
if IsLabel("^#h") MsgBox "Hotkey exists" else MsgBox "Hotkey doesn't exist" ^#h::return
if IsLabel("::btw") MsgBox "Hotstring exists" else MsgBox "Hotstring doesn't exist" ::btw::by the way