Sv Compare

From GECK

A function added by the New Vegas Script Extender.

Description

Compares a formatable string to a string variable. Returns 0 if the strings are equal, 1 if the string variable occurs alphabetically before the formatted string, -1 if the string variable occurs alphabetically after the formatted string, or -2 if the comparison fails. Comparison is case-insensitive by default, with the optional flag reversing this. Added by NVSE 4.1.

Syntax

(int) Sv_Compare Formatable:string Formatting ToCompareWith:string_var CaseSensitive:bool

Example

string_var my_string

let my_string := "Alpha"

sv_Compare "Beta", my_string ; * returns 1

See Also

Personal tools