Sv Length

From the Fallout3 GECK Wiki
Revision as of 15:24, 27 June 2014 by imported>Odessa (new)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
< [[::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
int iLength

let my_string := "Ringo"

let iLength := Sv_Length my_string ; == 5

As a condition, you need to use Eval:

string_var my_message

if eval Sv_Length my_message > 3
    ; then that string var contains more than 3 characters
endif

Notes

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

See Also