Difference between revisions of "Sv Length"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>Odessa
(new)
 
imported>Odessa
(removed extraneous)
 
Line 13: Line 13:
<pre>
<pre>
string_var my_string
string_var my_string
int iLength


let my_string := "Ringo"
let my_string := "Ringo"


let iLength := Sv_Length my_string ; == 5
Sv_Length my_string ; returns 5
</pre>
 
As a condition, you need to use [[Eval]]:
<pre>
string_var my_message
 
if eval Sv_Length my_message > 3
    ; then that string var contains more than 3 characters
endif
</pre>
</pre>
==Notes==
==Notes==

Latest revision as of 19:19, 28 June 2014

< [[::Category:Functions|Category:Functions]]

A function added by the New Vegas Script Extender.

Description

Added by NVSE V4. Returns the length of a string variable, which is the number of characters it contains.

Syntax

[help]
(int) Sv_Length ToMeasure:string_var

Example

string_var my_string

let my_string := "Ringo"

Sv_Length my_string ; returns 5

Notes

  • Remember that strings are indexed from 0, so the location of the final character is always:
    Sv_Length my_string - 1
    .

See Also