Sv Compare

From GECK
Jump to: navigation, search


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.

Syntax

[help]
(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

Notes

  • With Eval you can use the == operator to compare strings, which is the modern way to do string comparison.

See Also