Function %Int


Funkcia
Function converts parameter to value of type Integer
Deklarácia
INT %Int(
   UNIVAL in arg
 )
Parametre
argThe parameter over which the conversion is performed.
Popis

The function returns a value according to the following rules:

  • If the parameter is of type Integer, the same value is returned
  • If the parameter is of type Boolean, it returns 0 if @FALSE, 1 if @TRUE
  • If the parameter is of type Real Number or Relative Time, the rounded value is returned
  • If the parameter is of type Absolute Time or Text, the result is an Invalid value


 INT _i
 TIME _time = %StrToTime("17:03:16 18-03-2005")
 TEXT _text = "Hello world"

 _i := %Int(1.98)       ; _i = 2
 _i := %Int(-0.4)       ; _i = 0
 _i := %Int(@TRUE)      ; _i = 1
 _i := %Int(@FALSE)     ; _i = 0
 _i := %Int(_time)      ; _i = Invalid
 _i := %Int(_text)      ; _i = Invalid
Poznámka
The function may be used in:
Napíšte komentár