Skip to main content

$ZNAME (ObjectScript)

Special variable that contains the current routine name.

Synopsis

$ZNAME
$ZN

Description

$ZNAME contains the name of the routine executing on the current process. Commonly, this is the current routine loaded by ZLOAD. If no routine is currently executing, $ZNAME contains a null string.

When ZLOAD loads a routine, it becomes the currently loaded routine for the current process in all namespaces. Therefore, you can use $ZNAME to display the name of the currently loaded routine from any namespace, not just the namespace that it was loaded from.

Routine names are case-sensitive.

Note that a failed attempt to ZLOAD a routine removes the currently loaded routine, setting $ZNAME to the null string.

This special variable cannot be modified using the SET command. Attempting to do so results in a <SYNTAX> error.

The $ZNAME value can be set by the any of the following commands:

  • ZLOAD command

  • ZSAVE command

  • Argumentless ZREMOVE command (sets to a null string)

  • DO command

  • GOTO command with ^routine

FeedbackOpens in a new tab