$TableC: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Information provided by TABLEC command<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Information provided by TABLEC command<section end="desc" /></span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $TableC function is [[to be entered]].</p>
<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 [[Daemon methods|Daemon]] request into a StringList.</p>


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


The first argument, which is required, is a string identifying an image to receive returned data. This image should have the following format :
The first argument, which is required, is a string identifying an image to receive returned data. This image should have the following format :
<p class="code"> IMAGE TABLEC_IMAGE
<p class="code"> IMAGE TABLEC_IMAGE
FILE_NAME IS STRING LEN 8
    FILE_NAME IS STRING LEN 8
SLOTS_TOTAL IS BINARY LEN 4
  SLOTS_TOTAL IS BINARY LEN 4
SLOTS_USED IS BINARY LEN 4
    SLOTS_USED IS BINARY LEN 4
SLOTS_PCT IS BINARY LEN 4
    SLOTS_PCT IS BINARY LEN 4
  FOLLOWING FIELDS SET TO ZERO FOR PRE-8.1 FILES
  * FOLLOWING FIELDS SET TO ZERO FOR PRE-8.1 FILES
PROP_COUNT IS BINARY LEN 4
    PROP_COUNT IS BINARY LEN 4
PAGE_SPILL IS BINARY LEN 4
    PAGE_SPILL IS BINARY LEN 4
PROP_OVFL IS BINARY LEN 4
    PROP_OVFL IS BINARY LEN 4
PROP_SPCT IS BINARY LEN 4
    PROP_SPCT IS BINARY LEN 4
  END IMAGE
  END IMAGE
</p>
</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.


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.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> [%RESULT =] $TableC(image_name, file)
<p class="syntax"><section begin="syntax" /> [%RESULT =] $TableC(image_name, file)
Line 30: Line 31:
</p>
</p>
<p class="caption">%RESULT is a 0 or an error code.</p>
<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.<p>
 
0 - Image filled with Table C information
See the '''Model 204 File Manager's Guide''' for more information on the data returned by $TableC.
4 - File invalid
 
8 - File not open
<p class="code">
  0 - Image filled with Table C information
  4 - File invalid
  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
Line 39: Line 43:
<p class="caption">$TableC return codes
<p class="caption">$TableC return codes
</p>
</p>


The following program prints the percentage of slots used in table C of file ROSA.
The following program prints the percentage of slots used in table C of file ROSA.
Line 57: Line 60:
  END
  END
</p>
</p>
<p class="code">


<ul>
<ul>
 
<li>[[Sirius $Functions]]
<li>&SFUNC
 
</ul>
</ul>
</p>
<p class="caption">Products authorizing $TableC
<p class="caption">Products authorizing $TableC
</p>
</p>


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

Revision as of 20:38, 8 February 2011

<section begin="desc" />Information provided by TABLEC command<section end="desc" />

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 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 accepts two arguments and returns a number indicating the success of the function. It is also callable .

The first argument, which is required, 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

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.

Syntax

<section begin="syntax" /> [%RESULT =] $TableC(image_name, file) <section end="syntax" />

$TableC Function

%RESULT is a 0 or an error code.

See the Model 204 File Manager's Guide for more information on the data returned by $TableC.

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

$TableC return codes

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