$CommndL: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 25: Line 25:
<tr><th>width</th>
<tr><th>width</th>


<td>A number indicating the line width to be used for output lines. This is an optional argument, and it defaults to 256. Under ''[[Sirius Mods]]'' Version 6.2 and earlier: if this value is not in the range 1-256, the default is used. Under ''[[Sirius Mods]]'' Version 6.3 and later: this value can be specified as any value between 1 and the minimum LOBUFF value for any sdaemon thread in the Online, and if the value is not a valid number or not in this range, the request is cancelled.
</td></tr>
</table>


<td>A number indicating the line width to be used for output lines. This is an optional argument, and it defaults to 256. Under ''[[Sirius Mods]]'' Version 6.2 and earlier: if this value is not in the range 1-256, the default is used. Under ''[[Sirius Mods]]'' Version 6.3 and later: this value can be specified as any value between 1 and the minimum LOBUFF value for any sdaemon thread in the Online, and if the value is not a valid number or not in this range, the request is cancelled.
</td></tr></table>
<p class="code">  
<p class="code">  
0 - Command successfully executed
  0 - Command successfully executed
4 - Command processed, errors produced
  4 - Command processed, errors produced
8 - sdaemon restarted
  8 - sdaemon restarted
  12 - sdaemon required more input
  12 - sdaemon required more input
  16 - No sdaemons are running
  16 - No sdaemons are running
Line 40: Line 41:
<p class="caption">Return codes from $CommndL
<p class="caption">Return codes from $CommndL
</p>
</p>


The following program issues a VIEW command and displays the result at the user's terminal.
The following program issues a VIEW command and displays the result at the user's terminal.
Line 50: Line 49:
  PRINT $ListInf(%LIST, %I)
  PRINT $ListInf(%LIST, %I)
  END FOR
  END FOR
  END
  END
</p>
</p>
<p class="code">  
<p class="code">  
<ul>
<li>&JSOK - as of &vsn 6.1
<li>&JWEBS - as of &vsn 6.1
<li>&SFUNC
</ul>
</p>
<p class="caption">Products authorizing $CommndL
</p>


[[Category:$Functions|$CommndL]]
[[Category:$Functions|$CommndL]]

Revision as of 20:24, 31 January 2011

<section begin="desc" />Execute Model 204 command on sdaemon, results to $list<section end="desc" />

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $CommndL function is to be entered.

This function allows a Model 204 command to be executed on an sdaemon with the results captured into a $list. $CommndL performs the same function as $Command except that data is returned to a $list rather than an image.

The $CommndL function accepts five arguments and returns a number indicating the success of the function. It is also callable .

Syntax

<section begin="syntax" /> %rc = $CommndL(cmd, msgctl, list_id, file, width) <section end="syntax" />

$COMMANDL Function

%rc is set to 0 or an error code.

cmd A string containing the Model 204 command to be executed. This is a required argument.
msgctl A number indicating the setting to be used for MSGCTL when issuing the command in the sdaemon. This is an optional parameter, and it defaults to the user's current MSGCTL setting.
list_id The identifier of the $list that is to receive the command output. This is an optional parameter; if omitted, command output is placed on the audit trail as "AD" lines.
file A string indicating the name of a file that is to be automatically opened by the sdaemon and made the current file before cmd is executed. This file is opened with the same access privileges the user currently has for the file. This is an optional parameter.
width A number indicating the line width to be used for output lines. This is an optional argument, and it defaults to 256. Under Sirius Mods Version 6.2 and earlier: if this value is not in the range 1-256, the default is used. Under Sirius Mods Version 6.3 and later: this value can be specified as any value between 1 and the minimum LOBUFF value for any sdaemon thread in the Online, and if the value is not a valid number or not in this range, the request is cancelled.

0 - Command successfully executed 4 - Command processed, errors produced 8 - sdaemon restarted 12 - sdaemon required more input 16 - No sdaemons are running 20 - Out of storage 36 - Line control settings invalid 40 - Invalid file identifier

Return codes from $CommndL

The following program issues a VIEW command and displays the result at the user's terminal.

B %LIST = $ListNew %RC = $CommndL('VIEW', ,%LIST) FOR %I FROM 1 TO $ListCnt(%LIST) PRINT $ListInf(%LIST, %I) END FOR END