Previous Topic: DBG_PROMPT Command--Break Script Execution for Inspection (Cmdlet)Next Topic: del, rm Commands--Delete Files (Funclets)


DBG_PROMPT_LINE Command--Break Script Execution for Inspection With Line Numbers (Cmdlet)

The DBG_PROMPT_LINE command (cmdlet) interrupts script execution and displays an interactive prompt to evaluate expressions in the current script context. The prompt automatically includes the current line number. Typically used for inspecting current variable values, the debug prompt reoccurs until an empty input line is entered.

The command has the following syntax:

DBG_PROMPT_LINE [prompt]
prompt

Specifies a string with optional prompt to display. When using several prompts, the prompt can be used to indicate the location that triggered the interruption. If prompt is specified, it displays "prompt(n)> "

Default: "Dbg(n)> "

n

Displays the line number as input prompt.

Examples

Break during the last iteration of the loop:

for(i=0; i<11; i++)
{
    if(i==10)
    DBG_PROMPT_LINE
    ? i
}

Break using a custom prompt:

for(i=0; i<11; i++)
{
    if(i==10)
    DBG_PROMPT_LINE "i==10> "
    ? i
}

See also:

DBG_PROMPT Command--Break Script Execution for Inspection (Cmdlet)