51 lines
2.2 KiB
HTML
51 lines
2.2 KiB
HTML
<html>
|
|
<head>
|
|
<title>STAB Description</title>
|
|
<meta name="Author" content="Joey">
|
|
<link rel="STYLESHEET" type="text/css" href="../webdocs.css">
|
|
</head>
|
|
<body>
|
|
<h1>STAB Overview</h1>
|
|
<p>String tables have been a frequently-requested feature in APE,
|
|
and now they are available through a set of externs.
|
|
STAB stands for String TABle, and the interface generally relies
|
|
upon the usage of a STAB handle returned from a call to
|
|
<a href="stab_create.html"><b>STAB_Create</b></a>.</p>
|
|
|
|
<p>Once this handle is obtained, the ape script can begin to add
|
|
items to the list by using <a href="stab_append.html"><b>STAB_Append</b></a>.
|
|
Optionally, each string can also have an associated float value
|
|
which is set at the time that the string is added to the table.
|
|
</p>
|
|
|
|
<p>When the script is finished using the STAB object, it should call
|
|
<a href="stab_destroy.html"><b>STAB_Destroy</b></a>. A STAB object
|
|
which remains in use for the entire duration of the level and is not
|
|
explicitly destroyed from the script will be automatically destroyed
|
|
by the STAB system upon level exit.</p>
|
|
|
|
<p>There are several utility functions for manipulating STAB objects.
|
|
<a href="stab_getsize.html"><b>STAB_GetSize</b></a> returns
|
|
the number of elements in a STAB object. To retrieve a specific
|
|
string, <a href="stab_getelem.html"><b>STAB_GetElem</b></a> returns a
|
|
string at a specific index. To retrieve strings by matching the
|
|
associated float value, call
|
|
<a href="stab_getelembyfloat.html"><b>STAB_GetElemByFloat</b></a>.
|
|
If you worried about using exact float compares and want to match values
|
|
by rounding to the nearest integer, call
|
|
<a href="stab_getelembyint.html"><b>STAB_GetElemByInt</b></a>.
|
|
</p>
|
|
|
|
<p>To sort the elements of a STAB object in a case-sensitive manner,
|
|
call <a href="stab_sortbystring.html"><b>STAB_SortByString</b></a>. To
|
|
perform a case-insensitive sort, call
|
|
<a href="stab_sortbystringi.html"><b>STAB_SortByStringI</b></a>. To sort
|
|
by associated float values, call
|
|
<a href="stab_sortbyvalue.html"><b>STAB_SortByValue</b></a>.
|
|
|
|
<p>Docs courtesy of the creator
|
|
of STAB, Joey.</p>
|
|
|
|
<p><img src="joeymandel.gif" alt="mandelball" width="64" height="64"></p>
|
|
</body>
|
|
</html>
|