The STAB_Append function adds a string to a STAB (string table) object. The string is added to the end of the list.

extern STAB_Append
  float handle    // handle to STAB object
  string strval$  // string to store
  float fval      // (optional) float value to associate with string
  floatvar index  // (optional) float variable to receive the string index


[in] Handle to a STAB object previously returned from STAB_Create.
[in] The string that is to be added to the string table.
[in] The optional float value to be associated with this entry in the table. If unspecified, defaults to zero.
[out] The index of the added string will be returned in this variable.


STAB objects use zero-based indices, so the first string in the list will have an index of zero.

If handle is not a valid STAB handle, an error message will be printed to the console. No checking is done for out-of-memory conditions.

Also note that if the value of index may no longer refer to the same data after a subsequent call to one of the STAB sorting functions.


extern STAB_Create handle
extern STAB_Append handle "Hello, world!" 5
extern STAB_Append handle "Goodbye, world!" 10
extern STAB_Append handle "Append your mom." 92934
// Now your STAB object contains three strings,
// and you can do something useful with it...
extern STAB_Destroy handle