Echo.line

From AGI Wiki
Revision as of 13:12, 30 March 2019 by Andrew Korson (talk | contribs) (Created page with "The '''echo.line''' command adds the previous line of input to the current input line. == Syntax == echo.line(); == Remarks == When the player presses ENTER, AGI saves...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The echo.line command adds the previous line of input to the current input line.

Syntax

echo.line();

Remarks

When the player presses ENTER, AGI saves the most recent input text, then clears the input line. The echo.line command re-displays the previous input text on the input line.

If there is already text on the input line, only the characters from the previous line that exceed the number of characters currently on the line are added. If you want to make sure the entire previous line is copied, use the cancel.line command before calling the echo.line command.

If the input line is currently disabled (after using the prevent.input command), the echo.line command is ignored.

Possible Errors

None.

Example

Code:

<syntaxhighlight lang="agi"> [ assume previous input was "look ogre" [ and current input line is "talk" echo.line(); [ input line is now "talk ogre" ... cancel.line(); [ now clear the line echo.line(); [ input line is now "look ogre" </syntaxhighlight>

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 137 (0x89 hex)

See Also

accept.input
prevent.input