Difference between revisions of "HPL3/SOMA/Scripting/tString"
Jump to navigation
Jump to search
m |
|||
Line 34: | Line 34: | ||
// The message as printed: | // The message as printed: | ||
// Hi</syntaxhighlight> | // Hi</syntaxhighlight> | ||
+ | |||
+ | {{ReferencesSection}} | ||
{{HPL3SOMAScriptingCategories}} | {{HPL3SOMAScriptingCategories}} | ||
__FORCETOC__ | __FORCETOC__ |
Latest revision as of 16:13, 6 August 2020
A tString
is the HPL3 type for storing strings, or sequences of characters. They are created through use of a string literal, or a series of characters surrounded by quotation marks ( " ).
tString sStr = "This is a string.";
Contents
Fields
tString has no public fields.
Functions
Return Type | Function Name | Parameters | Description |
---|---|---|---|
uint64 |
length | Returns the length of the tString. | |
void |
resize | uint64 alLength |
Resizes the tString, removing characters and adding null characters as necessary. |
Remarks
A thing to note is that a tString
is essentially a wrapper for an array of characters, meaning that you can retrieve characters within a tString
by using square bracket ( [ ] ) syntax. (Characters in the HPL3 engine are represented by unsigned 8-bit integers, or uint8
.)
uint8 c = sStr[1];
A tString
is null-terminated, meaning that when a tString
is read (for example, in a cLux_AddDebugMessage
function), the tString
will only process its characters until it reaches a null-character, and characters after the null-character, if any, are ignored.
sStr.resize(5);
sStr[0] = 'H';
sStr[1] = 'i';
sStr[2] = '\0'; // This is a null-character
sStr[3] = 'Q';
sStr[4] = '9';
cLux_AddDebugMessage(sStr);
// The message as printed:
// Hi
References
- HPL3/SOMA/Scripting/cBeam (← links)
- HPL3/SOMA/Scripting/cAction (← links)
- HPL3/SOMA/Scripting/cActorAnimController (← links)
- HPL3/SOMA/Scripting/cAINode (← links)
- HPL3/SOMA/Scripting/cAINodeContainer (← links)
- HPL3/SOMA/Scripting/cAnimationState (← links)
- HPL3/SOMA/Scripting/cBeamEnd (← links)
- HPL3/SOMA/Scripting/cBillboard (← links)
- HPL3/SOMA/Scripting/cBoneState (← links)
- HPL3/SOMA/Scripting/cClothEntity (← links)
- HPL3/SOMA/Scripting/cConfigFile (← links)
- HPL3/SOMA/Scripting/cEnvironmentParticles (← links)
- HPL3/SOMA/Scripting/cEvent (← links)
- HPL3/SOMA/Scripting/cEventDatabase (← links)
- HPL3/SOMA/Scripting/cEventOwner (← links)
- HPL3/SOMA/Scripting/cEventScene (← links)
- HPL3/SOMA/Scripting/cEventTrigger (← links)
- HPL3/SOMA/Scripting/cExposureArea (← links)
- HPL3/SOMA/Scripting/cFactStateContainer (← links)
- HPL3/SOMA/Scripting/cFogArea (← links)
- HPL3/SOMA/Scripting/cForceField (← links)
- HPL3/SOMA/Scripting/cGuiGfxElement (← links)
- HPL3/SOMA/Scripting/cGuiGlobalShortcut (← links)
- HPL3/SOMA/Scripting/cGuiSet (← links)
- HPL3/SOMA/Scripting/cGuiSetEntity (← links)
- HPL3/SOMA/Scripting/cGuiSkin (← links)
- HPL3/SOMA/Scripting/cImGui (← links)
- HPL3/SOMA/Scripting/cImGuiFont (← links)
- HPL3/SOMA/Scripting/cImGuiGfx (← links)
- HPL3/SOMA/Scripting/cLensFlare (← links)
- HPL3/SOMA/Scripting/cLightBox (← links)
- HPL3/SOMA/Scripting/cLightDirectional (← links)
- HPL3/SOMA/Scripting/cLightPoint (← links)
- HPL3/SOMA/Scripting/cLightSpot (← links)
- HPL3/SOMA/Scripting/cLuxAgent (← links)
- HPL3/SOMA/Scripting/cLuxArea (← links)
- HPL3/SOMA/Scripting/cLuxBarkMachine (← links)
- HPL3/SOMA/Scripting/cLuxCharMover (← links)
- HPL3/SOMA/Scripting/cLuxCritter (← links)
- HPL3/SOMA/Scripting/cLuxDialogHandler (← links)
- HPL3/SOMA/Scripting/cLuxEntityMessageData (← links)
- HPL3/SOMA/Scripting/cLuxEventDatabaseHandler (← links)
- HPL3/SOMA/Scripting/cLuxGuiHandler (← links)
- HPL3/SOMA/Scripting/cLuxInputHandler (← links)
- HPL3/SOMA/Scripting/cLuxLiquidArea (← links)
- HPL3/SOMA/Scripting/cLuxMap (← links)
- HPL3/SOMA/Scripting/cLuxMoveState (← links)
- HPL3/SOMA/Scripting/cLuxMusicHandler (← links)
- HPL3/SOMA/Scripting/cLuxPathfinder (← links)
- HPL3/SOMA/Scripting/cLuxPlayer (← links)