IsLabel

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

Boolean := IsLabel(LabelName)

Parameters

LabelName

Type: String

The name of a label. The trailing colon should not be included.

Return Value

Type: Integer (boolean)

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

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.

Labels

Examples

Reports "Target label exists" because the label does exist.

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

Label:
return