<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://agiwiki.sierrahelp.com//index.php?action=history&amp;feed=atom&amp;title=Get.string</id>
	<title>Get.string - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://agiwiki.sierrahelp.com//index.php?action=history&amp;feed=atom&amp;title=Get.string"/>
	<link rel="alternate" type="text/html" href="http://agiwiki.sierrahelp.com//index.php?title=Get.string&amp;action=history"/>
	<updated>2026-09-20T16:05:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>http://agiwiki.sierrahelp.com//index.php?title=Get.string&amp;diff=12177&amp;oldid=prev</id>
		<title>Andrew Korson: Created page with &quot;The &#039;&#039;&#039;get.string&#039;&#039;&#039; command prompts the player to enter a string that can be manipulated in logic code.  == Syntax ==  get.string(str sA, msg mPROM...&quot;</title>
		<link rel="alternate" type="text/html" href="http://agiwiki.sierrahelp.com//index.php?title=Get.string&amp;diff=12177&amp;oldid=prev"/>
		<updated>2019-04-07T20:45:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The &amp;#039;&amp;#039;&amp;#039;get.string&amp;#039;&amp;#039;&amp;#039; command prompts the player to enter a &lt;a href=&quot;/index.php/String&quot; title=&quot;String&quot;&gt;string&lt;/a&gt; that can be manipulated in logic code.  == Syntax ==  get.string(&lt;a href=&quot;/index.php/String&quot; title=&quot;String&quot;&gt;str&lt;/a&gt; sA, &lt;a href=&quot;/index.php/Message&quot; title=&quot;Message&quot;&gt;msg&lt;/a&gt; mPROM...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;get.string&amp;#039;&amp;#039;&amp;#039; command prompts the player to enter a [[string]] that can be manipulated in logic code.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
get.string([[string|str]] sA, [[message|msg]] mPROMPT, [[number|byt]] ROW, [[number|byt]] COL, [[number|byt]] LEN);&amp;lt;br /&amp;gt;&lt;br /&gt;
get.string([[string|str]] sA, &amp;quot;prompt&amp;quot;, [[number|byt]] ROW, [[number|byt]] COL, [[number|byt]] LEN);&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remarks ==&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;get.string&amp;#039;&amp;#039;&amp;#039; command lets the programmer designate a location for the prompt and player input, instead of using the existing [[input line]] like the &amp;#039;&amp;#039;&amp;#039;[[get.num]]&amp;#039;&amp;#039;&amp;#039; command does. Message &amp;#039;&amp;#039;&amp;#039;mPROMPT&amp;#039;&amp;#039;&amp;#039; is used as the prompt, which is displayed at text column &amp;#039;&amp;#039;&amp;#039;COL&amp;#039;&amp;#039;&amp;#039;, row &amp;#039;&amp;#039;&amp;#039;ROW&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The last argument, &amp;#039;&amp;#039;&amp;#039;LEN&amp;#039;&amp;#039;&amp;#039;, is the maximum number of characters that the player can enter. &amp;#039;&amp;#039;&amp;#039;LEN&amp;#039;&amp;#039;&amp;#039; is limited to 40.  &lt;br /&gt;
&lt;br /&gt;
When running on a system using the Hercules Graphics Card (HGC), the &amp;#039;&amp;#039;&amp;#039;get.string&amp;#039;&amp;#039;&amp;#039; command normally uses an input box similar to the normal [[HGC input box]]. The &amp;#039;&amp;#039;&amp;#039;[[open.dialogue]]&amp;#039;&amp;#039;&amp;#039; command will cause the &amp;#039;&amp;#039;&amp;#039;get.string&amp;#039;&amp;#039;&amp;#039; command to operate the same as on other systems, as described above.&lt;br /&gt;
&lt;br /&gt;
== Possible Errors ==&lt;br /&gt;
&lt;br /&gt;
AGI does not automatically clear the prompt from the screen; it remains on the screen in the same way that text drawn by the &amp;#039;&amp;#039;&amp;#039;[[display]]&amp;#039;&amp;#039;&amp;#039; command. Calling the &amp;#039;&amp;#039;&amp;#039;[[graphics]]&amp;#039;&amp;#039;&amp;#039; command is one way to refresh the display and clear the prompt.&lt;br /&gt;
&lt;br /&gt;
If the prompt is drawn on top of the [[input line]], this will cause confusion if the player had text on the input line prior to the &amp;#039;&amp;#039;&amp;#039;get.string&amp;#039;&amp;#039;&amp;#039; call. The previous text will still exist on the line, but it won&amp;#039;t be visible. An easy workaround to this is to call the &amp;#039;&amp;#039;&amp;#039;[[prevent.input]]&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;[[accept.input]]&amp;#039;&amp;#039;&amp;#039; commands immediately after you use &amp;#039;&amp;#039;&amp;#039;get.string&amp;#039;&amp;#039;&amp;#039; to clear and restore the [[input line]].&lt;br /&gt;
&lt;br /&gt;
There is a minor bug in AGI that causes the [[input line]] to be offset by one space after calling the &amp;#039;&amp;#039;&amp;#039;get.string&amp;#039;&amp;#039;&amp;#039; command when a [[cursor]] character is being used. When AGI restores the input line after displaying the &amp;#039;&amp;#039;&amp;#039;get.string&amp;#039;&amp;#039;&amp;#039; prompt, it uses the position of the cursor, which is actually one space beyond the location of the last actual character. It will appear to the player that there is a space there when in reality there is not. This can be avoided by calling the &amp;#039;&amp;#039;&amp;#039;[[prevent.input]]&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;[[accept.input]]&amp;#039;&amp;#039;&amp;#039; commands immediately after you use &amp;#039;&amp;#039;&amp;#039;get.string&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
If a value for &amp;#039;&amp;#039;&amp;#039;LEN&amp;#039;&amp;#039;&amp;#039; greater than 40 is passed, AGI ignores it and uses 40. Also, AGI does not check to see if the total amount of space used for input (length of the prompt, plus the COL value, plus the LEN value) exceeds 40; if it does, the input will wrap around to column 0 of the next row, which may not be what was desired.&lt;br /&gt;
&lt;br /&gt;
AGI does not check that a valid [[string]] argument is passed. If an invalid string number is used (the limit is 24 [s0 - s23], except for [[versions]] 2.089, 2.272 and 3.002.149, which have a limit of 12 [s0 - s11]) AGI will overwrite areas of memory used for other purposes, which may result in [[crashing AGI]].&lt;br /&gt;
&lt;br /&gt;
If &amp;#039;&amp;#039;&amp;#039;ROW&amp;#039;&amp;#039;&amp;#039; is greater than 24, then both &amp;#039;&amp;#039;&amp;#039;COL&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;ROW&amp;#039;&amp;#039;&amp;#039; values are ignored, and the prompt will be displayed a the current [[input line]] location.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;agi&amp;quot;&amp;gt;&lt;br /&gt;
get.string(s5, &amp;quot;Password?&amp;quot;, 1, 0, 12);&lt;br /&gt;
print(&amp;quot;The password is &amp;#039;%s5&amp;#039;.&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Technical Information ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
| style=&amp;quot;background-color: #efefef&amp;quot; width=&amp;quot;200&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Required Interpreter Version:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| width=&amp;quot;175&amp;quot; | Available in all AGI versions.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #efefef&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Byte-Code Value:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| 115 (0x73 hex)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
[[String Commands]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[get.num]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[close.dialogue]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[open.dialogue]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
[[Category:Commands]]&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andrew Korson</name></author>
	</entry>
</feed>