$TableC: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
 
(13 intermediate revisions by 4 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Information provided by TABLEC command</span>
<span class="pageSubtitle">Information provided by TABLEC command</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $TableC function, but you can achieve the same results by capturing the output of a TABLEC command execute in a [[Daemon methods|Daemon]] request into a StringList.</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $TableC function, but you can achieve the same results by capturing the output of a TABLEC command executed in a <var>[[Daemon class|Daemon]]</var> request into a Stringlist.</p>


This function allows retrieval of the information provided in the TABLEC command from a <var class="product">User Language</var> program.  
This function allows retrieval of the information provided in the <var>TABLEC</var> command from a <var class="product">User Language</var> program.  


The $TableC function accepts two arguments and returns a number indicating the success of the function. It is also callable .  
The <var>$TableC</var> function is [[Calling Sirius Mods $functions|callable]].  


The first argument, which is required, is a string identifying an image to receive returned data. This image should have the following format :
==Syntax==
<p class="syntax">[%result =] $TableC(image_name, [file])
</p>


<p class="code"> IMAGE TABLEC_IMAGE
===Syntax terms===
    FILE_NAME IS STRING LEN 8
<table class="syntaxTable">
  SLOTS_TOTAL IS BINARY LEN 4
<tr><th>%result</th>
    SLOTS_USED IS BINARY LEN 4
<td>A numeric variable to receive 0 or an error code.</td></tr>
    SLOTS_PCT IS BINARY LEN 4
* FOLLOWING FIELDS SET TO ZERO FOR PRE-8.1 FILES
    PROP_COUNT IS BINARY LEN 4
    PAGE_SPILL IS BINARY LEN 4
    PROP_OVFL IS BINARY LEN 4
    PROP_SPCT IS BINARY LEN 4
END IMAGE
</p>


The second argument is the name of the file on which the $TableC function should operate. If this argument is not specified the default file at compilation time is used by $TableC.
<tr><th>image_name</th>
<td>This required argument is a string identifying an image to receive returned data. This image should have the following format :


==Syntax==
<p class="code">IMAGE TABLEC_IMAGE
<p class="syntax"><section begin="syntax" />[%RESULT =] $TableC(image_name, file)
    FILE_NAME IS STRING LEN 8
<section end="syntax" /></p>
  SLOTS_TOTAL IS BINARY LEN 4
  SLOTS_USED IS BINARY LEN 4
    SLOTS_PCT IS BINARY LEN 4
&#42; FOLLOWING FIELDS SET TO ZERO FOR PRE-8.1 FILES
  PROP_COUNT IS BINARY LEN 4
  PAGE_SPILL IS BINARY LEN 4
    PROP_OVFL IS BINARY LEN 4
    PROP_SPCT IS BINARY LEN 4
END IMAGE
</p>
<p>
<p>
</p>
See the [[TABLEC command]] and [[Tuning the hash index#Using the TABLEC command in Monitoring|Using the TABLEC command in monitoring]] for more information on the data returned by <var>$TableC</var>.</p></td></tr>
<p class="caption">%result is a 0 or an error code.</p>


See the '''Model 204 File Manager's Guide''' for more information on the data returned by $TableC.
<tr><th>file</th>
<td>The name of the file on which the <var>$TableC</var> function should operate. If this argument is not specified, the default file at compilation time is used by <var>$TableC</var>.</td></tr>
</table>


<p class="code">
===Return codes===
  0 - Image filled with Table C information
<p class="code"> 0 - Image filled with Table C information
  4 - File invalid
4 - File invalid
  8 - File not open
8 - File not open
12 - Image specified by argument 1 not found
12 - Image specified by argument 1 not found
16 - Image specified by argument 1 not active or too short
16 - Image specified by argument 1 not active or too short
</p>
<p class="caption">$TableC return codes
</p>
</p>


The following program prints the percentage of slots used in table C of file ROSA.
==Example==
<p class="code"> B
The following program prints the percentage of slots used in Table C of file <code>ROSA</code>.
IMAGE JUNK
<p class="code">B
FILE_NAME IS STRING LEN 8
IMAGE JUNK
FILE_NAME IS STRING LEN 8
  ...
  ...
END IMAGE
END IMAGE
   
   
PREPARE IMAGE JUNK
PREPARE IMAGE JUNK
%RC = $TableC('JUNK', 'ROSA')
%RC = $TableC('JUNK', 'ROSA')
IF %RC ^= 0 THEN
IF %RC ^= 0 THEN
    STOP
  STOP
END IF
END IF
PRINT %JUNK:SLOTS_PCT
PRINT %JUNK:SLOTS_PCT
   
   
END
END
</p>
</p>


<h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList">
 
<li>[[Sirius $Functions]]
==Products authorizing {{PAGENAMEE}}==
<ul class="smallAndTightList">
<li>[[List of $functions|Sirius functions]]</li>
</ul>
</ul>
<p>
 
</p>


[[Category:$Functions|$TableC]]
[[Category:$Functions|$TableC]]

Latest revision as of 23:23, 20 September 2018

Information provided by TABLEC command

Note: Many $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $TableC function, but you can achieve the same results by capturing the output of a TABLEC command executed in a Daemon request into a Stringlist.

This function allows retrieval of the information provided in the TABLEC command from a User Language program.

The $TableC function is callable.

Syntax

[%result =] $TableC(image_name, [file])

Syntax terms

%result A numeric variable to receive 0 or an error code.
image_name This required argument is a string identifying an image to receive returned data. This image should have the following format :

IMAGE TABLEC_IMAGE FILE_NAME IS STRING LEN 8 SLOTS_TOTAL IS BINARY LEN 4 SLOTS_USED IS BINARY LEN 4 SLOTS_PCT IS BINARY LEN 4 * FOLLOWING FIELDS SET TO ZERO FOR PRE-8.1 FILES PROP_COUNT IS BINARY LEN 4 PAGE_SPILL IS BINARY LEN 4 PROP_OVFL IS BINARY LEN 4 PROP_SPCT IS BINARY LEN 4 END IMAGE

See the TABLEC command and Using the TABLEC command in monitoring for more information on the data returned by $TableC.

file The name of the file on which the $TableC function should operate. If this argument is not specified, the default file at compilation time is used by $TableC.

Return codes

0 - Image filled with Table C information 4 - File invalid 8 - File not open 12 - Image specified by argument 1 not found 16 - Image specified by argument 1 not active or too short

Example

The following program prints the percentage of slots used in Table C of file ROSA.

B IMAGE JUNK FILE_NAME IS STRING LEN 8 ... END IMAGE PREPARE IMAGE JUNK %RC = $TableC('JUNK', 'ROSA') IF %RC ^= 0 THEN STOP END IF PRINT %JUNK:SLOTS_PCT END


Products authorizing $TableC