<h3>4 <span class="Heading">Console User Interface</span></h3>
<p>HPC-GAP has a multi-threaded user interface to assist with the development and debugging of concurrent programs. This user interface is enabled by default; to disable it, and use the single-threaded interface, GAP has to be started with the <code class="code">-S</code> option.</p>
<p>The console user interface provides the user with the option to control threads by commands prefixed with an exclamation mark ("!"). Those commands are listed below.</p>
<p>For ease of use, users only need to type as many letters of each commands so that it can be unambiguously selected. Thus, the shell will recognize <code class="code">!l</code> as an abbreviation for <code class="code">!list</code>.</p>
<p>List all current threads that are interacting with the user. This does not list threads created with <code class="code">CreateThread()</code> that have not entered a break loop.</p>
<p>Hide output from the thread with the numerical identifier or name <code class="code">id</code> when it is not the foreground thread. If no thread is specified, make this the default behavior for future threads.</p>
<p>Show output from the thread with the numerical identifier or name <code class="code">id</code> even when it is not the foreground thread. If no thread is specified, make this the default behavior for future threads.</p>
<p>Set the prompt for the specified thread (or for all newly created threads if <code class="code">*</code> was specified) to be <code class="code">string</code>. If the string contains the pattern <code class="code">id</code>, it is replaced with the numerical id of the thread; if it contains the pattern <code class="code">name</code>, it is replaced with the name of the thread; if the thread has no name, the numerical id is displayed instead.</p>
<p>Prefix the output from the specified thread (or for all newly created threads if <code class="code">*</code> was specified) with <code class="code">string</code>. The same substitution rules as for the <code class="code">!prompt</code> command apply.</p>
<h5>4.1-16 <span class="Heading">!replay num [id]</span></h5>
<p>Display the last <code class="code">num</code> lines of output of the specified thread. If no thread was specified, display the last <code class="code">num</code> lines of the current foreground thread.</p>
<p>Create an alias. After defining the alias, <code class="code">!shortcut 'rest of line'</code> will be replaced with <code class="code">!expansion 'rest of line'</code>.</p>
<h5>4.1-22 <span class="Heading">!run function string</span></h5>
<p>Calls the function with name <code class="code">function</code>, passing it the single argument <code class="code">string</code> as a GAP string.</p>
<h4>4.2 <span class="Heading">GAP functions to access the Shell UI</span></h4>
<p>There are several functions to access the basic functionality of the shell user interface. Other than <code class="func">TextUIRegisterCommand</code> (<a href="chap4_mj.html#X84154E44780A3402"><span class="RefLink">4.2-1</span></a>), they can only be called from within a registered command.</p>
<p>Threads can be specified either by their numerical identifier or by their name (as a string). The empty string can be used to specify the current foreground thread.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUIRegisterCommand</code>( <var class="Arg">name</var>, <var class="Arg">func</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Registers the command <code class="code">!name</code> with the shell UI. It will call <func> with the rest of the command line passed as a string argument when typed.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUIForegroundThread</code>( )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns the numerical identifier of the current foreground thread.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUIForegroundThreadName</code>( )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns the name of the current foreground thread or <code class="keyw">fail</code> if the current foreground thread has no name.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUIOutputHistory</code>( <var class="Arg">id</var>, <var class="Arg">count</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns the last <var class="Arg">count</var> lines of the thread specified by <var class="Arg">id</var> (which can be a numerical identifier or a name). Returns <code class="keyw">fail</code> if there is no such thread.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUISetOutputHistoryLength</code>( <var class="Arg">length</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>By default, retain <var class="Arg">length</var> lines of output history from each thread.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUINewSession</code>( <var class="Arg">foreground</var>, <var class="Arg">name</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Creates a new shell thread. Here, <var class="Arg">foreground</var> is a boolean variable specifying whether it should be made the new foreground thread and <var class="Arg">name</var> is the name of the thread. The empty string can be used to leave the thread without a name.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUIRunCommand</code>( <var class="Arg">command</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Run the command denoted by <var class="Arg">command</var> as though a user had typed it. The command must not contain a newline character.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUIWritePrompt</code>( )</td><td class="tdright">( function )</td></tr></table></div>
<p>Display a prompt for the current thread.</p>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.