anachronox-sdk/docs/stab/stab_getsize.html
2002-01-21 00:00:00 +00:00

49 lines
1.3 KiB
HTML

<html>
<head>
<title>STAB_GetSize</title>
<meta name="Author" content="Joey">
<link rel="stylesheet" type="text/css" href="../webdocs.css">
</head>
<body>
<h1><a name="ape_stab_getsize"></a>STAB_GetSize</h3>
<p>The <b>STAB_GetSize</b> function returns the number of strings
stored in a STAB object.</p>
<PRE class="syntax"><b>extern STAB_GetSize</b>
<b> float</b><i> handle</i> // handle to STAB
<b> floatvar</b><i> size</i> // float variable to receive STAB size
</PRE>
<h4>Parameters</h4>
<dl>
<dt><i>handle</i></dt>
<dd>[in] Handle to a STAB object previously returned from
<a href="stab_create.html"><b>STAB_Create</b></a>.
</dd>
<dt><i>size</i></dt>
<dd>[out] The number of strings in the table
will be returned in this variable.
</dl>
<h4>Remarks</h4>
<p>If <i>handle</i> is not a valid STAB handle, an error message will
be printed to the console.</p>
<h4>Example</h4>
<p>The following code fragment demonstrates how to use a loop to retrieve
every element in a STAB object.
<pre>// Assume @handle is already initialized to
// a STAB object with data in it.
extern STAB_GetSize @handle @size
@i = 0
while (@i < @size)
{
STAB_GetElem @handle @i @str$
// Do something useful with the string.
}</pre>
</body>
</html>