commandloop(TCLX)

commandloop(TCLX)


commandloop -- create interactive command loop for Tcl interpreter

Syntax

commandloop [prompt1] [prompt2]

Description

Creates an interactive command loop for the current Tcl interpreter. This command receives commands from stdin and executes them. It is useful for Tcl scripts that do not normally converse interactively with a user through a Tcl command interpreter, but sometimes want to enter this mode.

prompt1 is a Tcl command string that is evaluated to determine the text of the prompt string. The old value of tcl_prompt1 is saved and prompt is set to this value for the duration of the command loop. prompt2 is a command string that is evaluated to determine the ``downlevel prompt'', which is the prompt issued for continuation input. The old value of tcl_prompt2 is saved and the prompt is set to this value for the duration of the command loop.

When the command terminates, the variables for the prompt hooks will be set to their old value. If these arguments are not specified, the prompt hooks use their current value.