IsLabel

Returns a non-zero number if the specified label exists in the current scope.

IsLabel := IsLabel(LabelName)

Parameters

LabelName

Type: String

The name of a label.

Return Value

Type: Integer (boolean)

This function returns 1 (true) if the specified label exists within the current scope, or 0 (false) if not.

Remarks

This function is useful to avoid runtime errors when specifying a dynamic label for Goto.

When called from inside a function, only that function's labels are searched. Global labels are not valid targets for a local goto.

Related

Labels

Examples

#1

if IsLabel("Label")
    MsgBox "Target label exists"
else
    MsgBox "Target label doesn't exist"

Label:
return