-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a35a41b
commit 9ebdc0a
Showing
43 changed files
with
1,961 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<html> | ||
<head> | ||
<title>HyperTalk 2.2 Commands - add</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<meta name="generator" content="XIONDoc 1.3"> | ||
<meta name="keywords" content="XION, OpenXION, XIONDoc, XIONDocs, XION docs, OpenXION docs, XION documentation, OpenXION documentation, XION manual, OpenXION manual, HyperTalk, HyperTalk clone, xTalk, HyperTalk, HyperTalk 2.2, command, commands, add"> | ||
<meta name="description" content="This page describes the add command."> | ||
<link rel="stylesheet" type="text/css" href="../xiondoc.css"> | ||
</head> | ||
<body> | ||
<h1>Commands</h1> | ||
<h2>add</h2> | ||
<h3>Supported By</h3> | ||
<ul class="block unorderedlist indent0 border0 nobullet"> | ||
<li>XION Scripting Language Standard (1.0)</li> | ||
<li>OpenXION (1.0, 1.1, 1.2, 1.3, 1.4)</li> | ||
<li>OpenXION Standard Module (1.0, 1.1, 1.2, 1.3, 1.4)</li> | ||
<li>HyperTalk (2.2)</li> | ||
</ul> | ||
<h3>Syntax</h3> | ||
<p class="block syntax indent0"><code class="keyword">add</code> <em class="metavariable">number</em> <code class="keyword">to</code> <em class="metavariable">container</em></p> | ||
<p class="block paragraph indent0"> <em class="metavariable">Number</em> yields an <code><a href="../dt/integer.html">integer</a></code>, a <code><a href="../dt/number.html">number</a></code>, or a <code>complex</code>. <em class="metavariable">Container</em> yields a container containing an <code><a href="../dt/integer.html">integer</a></code>, a <code><a href="../dt/number.html">number</a></code>, or a <code>complex</code>. </p> | ||
<h3>Examples</h3> | ||
<pre class="block script indent0"> | ||
add 3 to it | ||
</pre> | ||
<pre class="block script indent0"> | ||
add amount to total | ||
</pre> | ||
<h3>Description</h3> | ||
<p class="block paragraph indent0"> The <code>add</code> command adds the value of <em class="metavariable">number</em> to the value of <em class="metavariable">container</em> and leaves the result in <em class="metavariable">container</em>. The value in the container must be an <code><a href="../dt/integer.html">integer</a></code>, a <code><a href="../dt/number.html">number</a></code>, or a <code>complex</code> and is replaced with the new value. </p> | ||
<h3>Script</h3> | ||
<p class="block paragraph indent0"> The following example sums a line-delimited list of numbers and prints the result. </p> | ||
<pre class="block script indent0"> | ||
on printSum numberList | ||
put 0 into total | ||
repeat with count = 1 to the number of lines ¬ | ||
in numberList | ||
add line count of numberList to total | ||
end repeat | ||
put total | ||
end printSum | ||
</pre> | ||
<h3>See Also</h3> | ||
<p class="block paragraph indent0"><code><a href="../cm/subtract.html">subtract</a></code>, <code><a href="../cm/multiply.html">multiply</a></code>, <code><a href="../cm/divide.html">divide</a></code>, <code><a href="../op/$002B.html">+</a></code>, <code><a href="../fn/sum.html">sum</a></code></p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<html> | ||
<head> | ||
<title>HyperTalk 2.2 Commands - answer</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<meta name="generator" content="XIONDoc 1.3"> | ||
<meta name="keywords" content="XION, OpenXION, XIONDoc, XIONDocs, XION docs, OpenXION docs, XION documentation, OpenXION documentation, XION manual, OpenXION manual, HyperTalk, HyperTalk clone, xTalk, HyperTalk, HyperTalk 2.2, command, commands, answer"> | ||
<meta name="description" content="This page describes the answer command."> | ||
<link rel="stylesheet" type="text/css" href="../xiondoc.css"> | ||
</head> | ||
<body> | ||
<h1>Commands</h1> | ||
<h2>answer</h2> | ||
<h3>Supported By</h3> | ||
<ul class="block unorderedlist indent0 border0 nobullet"> | ||
<li>XION Scripting Language Standard (1.0)</li> | ||
<li>OpenXION (1.0, 1.1, 1.2, 1.3, 1.4)</li> | ||
<li>OpenXION Standard Module (1.0, 1.1, 1.2, 1.3, 1.4)</li> | ||
<li>HyperTalk (2.2)</li> | ||
</ul> | ||
<h3>Syntax</h3> | ||
<p class="block syntax indent0"><code class="keyword">answer</code> <em class="metavariable">question</em> <span class="optional"><span class="metasymbol">[</span><code class="keyword">with</code> <em class="metavariable">reply</em> <span class="optional"><span class="metasymbol">[</span><code class="keyword">or</code> <em class="metavariable">reply</em> <span class="optional"><span class="metasymbol">[</span><code class="keyword">or</code> <em class="metavariable">reply</em><span class="metasymbol">]</span></span><span class="metasymbol">]</span></span><span class="metasymbol">]</span></span> <span class="optional"><span class="metasymbol">[</span><code class="keyword">at</code> <em class="metavariable">point</em><span class="metasymbol">]</span></span></p> | ||
<p class="block syntax indent0"><code class="keyword">answer</code> <code class="keyword">list</code> <em class="metavariable">promptText</em> <code class="keyword">with</code> <em class="metavariable">list</em> <span class="optional"><span class="metasymbol">[</span><code class="keyword">at</code> <em class="metavariable">point</em><span class="metasymbol">]</span></span></p> | ||
<p class="block syntax indent0"><code class="keyword">answer</code> <code class="keyword">file</code> <em class="metavariable">promptText</em> <span class="optional"><span class="metasymbol">[</span><code class="keyword">of</code> <code class="keyword">type</code> <em class="metavariable">fileType</em> <span class="optional"><span class="metasymbol">[</span><code class="keyword">or</code> <em class="metavariable">fileType</em> <span class="optional"><span class="metasymbol">[</span><code class="keyword">or</code> <em class="metavariable">fileType</em><span class="metasymbol">]</span></span><span class="metasymbol">]</span></span><span class="metasymbol">]</span></span> <span class="optional"><span class="metasymbol">[</span><code class="keyword">at</code> <em class="metavariable">point</em><span class="metasymbol">]</span></span></p> | ||
<p class="block syntax indent0"><code class="keyword">answer</code> <span class="choice"><span class="metasymbol">(</span><code class="keyword">folder</code><span class="metasymbol">|</span><code class="keyword">directory</code><span class="metasymbol">)</span></span> <em class="metavariable">promptText</em> <span class="optional"><span class="metasymbol">[</span><code class="keyword">at</code> <em class="metavariable">point</em><span class="metasymbol">]</span></span></p> | ||
<p class="block syntax indent0"><code class="keyword">answer</code> <span class="choice"><span class="metasymbol">(</span><code class="keyword">disk</code><span class="metasymbol">|</span><code class="keyword">volume</code><span class="metasymbol">)</span></span> <em class="metavariable">promptText</em> <span class="optional"><span class="metasymbol">[</span><code class="keyword">at</code> <em class="metavariable">point</em><span class="metasymbol">]</span></span></p> | ||
<p class="block paragraph indent0"> <em class="metavariable">Question</em>, <em class="metavariable">reply</em>, <em class="metavariable">promptText</em>, and <em class="metavariable">fileType</em> yield <code>string</code>s. <em class="metavariable">List</em> yields a <code>list</code>. <em class="metavariable">Point</em> yields a <code><a href="../dt/point.html">point</a></code>. </p> | ||
<h3>Examples</h3> | ||
<pre class="block script indent0"> | ||
answer "Which is the way the world ends?" with "Bang" or "Whimper" | ||
</pre> | ||
<pre class="block script indent0"> | ||
answer file "Pick a file:" | ||
</pre> | ||
<h3>Description</h3> | ||
<p class="block paragraph indent0"> The <code>answer</code> command displays a prompt to the user with up to three possible responses. The last response appears as the default response to the prompt. If no possible responses are specified, a single possible response will be presented with the text "OK." The script waits until one of the possible responses is chosen. The chosen response is placed in the local variable <code>it</code>. </p> | ||
<p class="block paragraph indent0"> The <code>answer list</code> command displays a prompt to the user with a list of any number of possible responses. The script waits until one of the possible responses is selected. The chosen response is placed in the local variable <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"OK"</code>. If the prompt is dismissed without choosing a response, <code><a href="../cn/empty.html">empty</a></code> is placed in <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"Cancel"</code>. </p> | ||
<p class="block paragraph indent0"> The <code>answer file</code> command displays a prompt to the user asking to select a file. The script waits until a file is selected. The path of the selected file is placed in the local variable <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"OK"</code>. If the prompt is dismissed without selecting a file, <code><a href="../cn/empty.html">empty</a></code> is placed in <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"Cancel"</code>. </p> | ||
<p class="block paragraph indent0"> The <code>answer folder</code> or <code>answer directory</code> command displays a prompt to the user asking to select a folder. The script waits until a folder is selected. The path of the selected folder is placed in the local variable <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"OK"</code>. If the prompt is dismissed without selecting a folder, <code><a href="../cn/empty.html">empty</a></code> is placed in <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"Cancel"</code>. </p> | ||
<p class="block paragraph indent0"> The <code>answer disk</code> or <code>answer volume</code> command displays a prompt to the user asking to select a disk or volume. The script waits until a volume is selected. The path of the selected volume is placed in the local variable <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"OK"</code>. If the prompt is dismissed without selecting a volume, <code><a href="../cn/empty.html">empty</a></code> is placed in <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"Cancel"</code>. </p> | ||
<p class="block paragraph indent0"> The exact presentation of the prompts is left to the implementation. OpenXION presents a stylized text-based prompt, or a plain text-based prompt if the <code>-p</code> option is given. A GUI-based system, like HyperCard, will present an appropriate dialog box. The <code class="keyword">at</code> parameter gives a preferred location for this dialog box. </p> | ||
<h3>Script</h3> | ||
<pre class="block script indent0"> | ||
on chooseColor | ||
answer "Which color do you prefer?" with "Red" or ¬ | ||
"Blue" or "Yellow" | ||
if it is "Red" then answer "You picked red." | ||
else if it is "Blue" then answer "You picked blue." | ||
else if it is "Yellow" then answer "You picked yellow." | ||
end chooseColor | ||
</pre> | ||
<h3>Note</h3> | ||
<p class="block paragraph indent0"> There is no way for a script to respond to a prompt by itself, so do not use <code>answer</code> in a script intended to run unattended. </p> | ||
<h3>Compatibility</h3> | ||
<p class="block paragraph indent0"> HyperTalk does not support the <code>answer list</code>, <code>answer directory</code>, <code>answer disk</code>, or <code>answer volume</code> forms, or the <code>at</code> parameter. However, the Power Tools stack has the <code>ShowList</code> XFCN that inspired the <code>answer list</code> command and HyperTalk itself has an <code>answer program</code> form that OpenXION does not. </p> | ||
<h3>See Also</h3> | ||
<p class="block paragraph indent0"><code><a href="../cm/ask.html">ask</a></code></p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<html> | ||
<head> | ||
<title>HyperTalk 2.2 Commands - ask</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<meta name="generator" content="XIONDoc 1.3"> | ||
<meta name="keywords" content="XION, OpenXION, XIONDoc, XIONDocs, XION docs, OpenXION docs, XION documentation, OpenXION documentation, XION manual, OpenXION manual, HyperTalk, HyperTalk clone, xTalk, HyperTalk, HyperTalk 2.2, command, commands, ask"> | ||
<meta name="description" content="This page describes the ask command."> | ||
<link rel="stylesheet" type="text/css" href="../xiondoc.css"> | ||
</head> | ||
<body> | ||
<h1>Commands</h1> | ||
<h2>ask</h2> | ||
<h3>Supported By</h3> | ||
<ul class="block unorderedlist indent0 border0 nobullet"> | ||
<li>XION Scripting Language Standard (1.0)</li> | ||
<li>OpenXION (1.0, 1.1, 1.2, 1.3, 1.4)</li> | ||
<li>OpenXION Standard Module (1.0, 1.1, 1.2, 1.3, 1.4)</li> | ||
<li>HyperTalk (2.2)</li> | ||
</ul> | ||
<h3>Syntax</h3> | ||
<p class="block syntax indent0"><code class="keyword">ask</code> <em class="metavariable">question</em> <span class="optional"><span class="metasymbol">[</span><code class="keyword">with</code> <em class="metavariable">defaultAnswer</em><span class="metasymbol">]</span></span> <span class="optional"><span class="metasymbol">[</span><code class="keyword">at</code> <em class="metavariable">point</em><span class="metasymbol">]</span></span></p> | ||
<p class="block syntax indent0"><code class="keyword">ask</code> <code class="keyword">password</code> <span class="optional"><span class="metasymbol">[</span><code class="keyword">clear</code><span class="metasymbol">]</span></span> <em class="metavariable">question</em> <span class="optional"><span class="metasymbol">[</span><code class="keyword">with</code> <em class="metavariable">defaultAnswer</em><span class="metasymbol">]</span></span> <span class="optional"><span class="metasymbol">[</span><code class="keyword">at</code> <em class="metavariable">point</em><span class="metasymbol">]</span></span></p> | ||
<p class="block syntax indent0"><code class="keyword">ask</code> <code class="keyword">file</code> <em class="metavariable">promptText</em> <span class="optional"><span class="metasymbol">[</span><code class="keyword">with</code> <em class="metavariable">fileName</em><span class="metasymbol">]</span></span> <span class="optional"><span class="metasymbol">[</span><code class="keyword">at</code> <em class="metavariable">point</em><span class="metasymbol">]</span></span></p> | ||
<p class="block syntax indent0"><code class="keyword">ask</code> <span class="choice"><span class="metasymbol">(</span><code class="keyword">folder</code><span class="metasymbol">|</span><code class="keyword">directory</code><span class="metasymbol">)</span></span> <em class="metavariable">promptText</em> <span class="optional"><span class="metasymbol">[</span><code class="keyword">with</code> <em class="metavariable">fileName</em><span class="metasymbol">]</span></span> <span class="optional"><span class="metasymbol">[</span><code class="keyword">at</code> <em class="metavariable">point</em><span class="metasymbol">]</span></span></p> | ||
<p class="block paragraph indent0"> <em class="metavariable">Question</em>, <em class="metavariable">defaultAnswer</em>, <em class="metavariable">promptText</em>, and <em class="metavariable">fileName</em> yield <code>string</code>s. <em class="metavariable">Point</em> yields a <code><a href="../dt/point.html">point</a></code>. </p> | ||
<h3>Examples</h3> | ||
<pre class="block script indent0"> | ||
ask "Who needs this kind of grief?" with "Not me." | ||
</pre> | ||
<pre class="block script indent0"> | ||
ask password "Please enter your password:" | ||
</pre> | ||
<pre class="block script indent0"> | ||
ask file "Save this file as:" with "Untitled-1" | ||
</pre> | ||
<h3>Description</h3> | ||
<p class="block paragraph indent0"> The <code>ask</code> command displays a prompt to the user and allows the user to type a response. The optional <em class="metavariable">defaultAnswer</em> parameter specifies a response that initially appears. The prompt appears with "OK" and "Cancel" choices as well. The script waits until a response is typed and one of the choices is selected. If the "OK" choice is selected, the typed text is placed in the local variable <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"OK"</code>. If the "Cancel" choice is selected, <code><a href="../cn/empty.html">empty</a></code> is placed in <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"Cancel"</code>. </p> | ||
<p class="block paragraph indent0"> The <code>ask password</code> command hides the response from the user as it is being typed and hashes the response using the Atkinson hash (see the <code>hash</code> function). The hashed response can be stored somewhere to be compared to a later response to <code>ask password</code> if, for example, you want the user to be able to protect data they enter. </p> | ||
<p class="block paragraph indent0"> The <code>ask password clear</code> command hides the response from the user as it is being typed, but does not hash the response. </p> | ||
<p class="block paragraph indent0"> The <code>ask file</code> command displays a prompt to the user asking for the location and name of a new file. The optional <em class="metavariable">fileName</em> parameter specifies a file name that initially appears. The script waits until a file name is entered. The file path is placed in the local variable <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"OK"</code>. If the prompt is dismissed without entering a file name, <code><a href="../cn/empty.html">empty</a></code> is placed in <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"Cancel"</code>. </p> | ||
<p class="block paragraph indent0"> The <code>ask folder</code> or <code>ask directory</code> command displays a prompt to the user asking for the location and name of a new folder or directory. The optional <em class="metavariable">fileName</em> parameter specifies a folder name that initially appears. The script waits until a folder name is entered. The directory path is placed in the local variable <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"OK"</code>. If the prompt is dismissed without entering a folder name, <code><a href="../cn/empty.html">empty</a></code> is placed in <code>it</code> and the <code><a href="../fn/result.html">result</a></code> is set to <code>"Cancel"</code>. </p> | ||
<p class="block paragraph indent0"> The exact presentation of the prompts is left to the implementation. OpenXION presents a stylized text-based prompt, or a plain text-based prompt if the <code>-p</code> option is given. A GUI-based system, like HyperCard, will present an appropriate dialog box. The <code class="keyword">at</code> parameter gives a preferred location for this dialog box. </p> | ||
<h3>Notes</h3> | ||
<p class="block paragraph indent0"> The <code>ask password</code> command is not recommended for cryptographic purposes because the Atkinson hash algorithm is easily brute-forced. Instead, use the <code>ask password clear</code> command, then hash the cleartext password using a more secure <code>hash</code> algorithm. </p> | ||
<p class="block paragraph indent0"> The <code>ask file</code>, <code>ask folder</code>, and <code>ask directory</code> commands do not actually create the selected file or folder. The script must create the file or folder itself. </p> | ||
<p class="block paragraph indent0"> There is no way for a script to respond to a prompt by itself, so do not use <code>ask</code> in a script intended to run unattended. </p> | ||
<h3>Compatibility</h3> | ||
<p class="block paragraph indent0"> HyperTalk does not support the <code>ask folder</code> or <code>ask directory</code> forms, or the <code>at</code> parameter. </p> | ||
<h3>See Also</h3> | ||
<p class="block paragraph indent0"><code><a href="../cm/answer.html">answer</a></code></p> | ||
</body> | ||
</html> |
Oops, something went wrong.