DIAdem Help

Method: Sgn for VBS

  • Updated2024-09-12
  • 1 minute(s) read

Method: Sgn for VBS

Specifies the sign of a number.

vSgn = Object.Sgn(number)
ObjectVBS
Object with this method. You do not need to specify this object.
numberVariant
Specifies a numeric value.
vSgnVariant
Receives the sign of number. The value is -1 for negative values, 0 for the value 0, and 1 for positive values.

The following example specifies the sign of various numbers:

Call MsgBox(Sgn(99.2))   ' Returns 1
Call MsgBox(Sgn(-99.8))  ' Returns -1
Call MsgBox(Sgn(0))      ' Returns 0

See Also

Objects Overview

Related Topics

Abs | Asc | AscB | AscW | CBool | CByte | CCur | CDate | CDbl | CInt | CLng | CSng | CStr | ChrB | ChrW | Chr | Escape | Fix | Hex | Int | Oct | Sgn | UnEscape