PreviousNextIndex

INT64 function

Takes any data type and returns an INT64 value, if the conversion is possible. This function takes most common data types except for RAW and MEMPTR.

Syntax

INT64 ( expression ) 

expression
Example

The following example demonstrates how to use the INT64 function to convert a variety of data types to the INT64 data type:

r-int64.p 
DEFINE VARIABLE myint   AS INTEGER   NO-UNDO 
  INITIAL 2000000000 FORMAT "->>,>>>,>>>,>>>". 
DEFINE VARIABLE myint64 AS INT64     NO-UNDO 
  INITIAL 333444555666 FORMAT "->>,>>>,>>>,>>>,>>>". 
DEFINE VARIABLE mychar  AS CHARACTER NO-UNDO INITIAL "2234.3". 
DEFINE VARIABLE mydec   AS DECIMAL   NO-UNDO INITIAL "240,234.05". 
DEFINE VARIABLE mybool  AS LOGICAL   NO-UNDO INITIAL TRUE. 
DEFINE VARIABLE mydate  AS DATE      NO-UNDO INITIAL 01/01/06. 
DEFINE VARIABLE myhdl   AS HANDLE    NO-UNDO. 
DEFINE FRAME x WITH TITLE "emptyframe". 
myhdl = FRAME x:handle. 
MESSAGE "integer of integer expression is" INTEGER(myint). 
MESSAGE "integer of int64 expression is" INTEGER(myint64 - 333000000000). 
MESSAGE "integer of int64 >2gig is" INTEGER(myint64). 
MESSAGE "integer of char is" INTEGER(mychar). 
MESSAGE "integer of dec is" INTEGER(mydec). 
MESSAGE "integer of bool is" INTEGER(mybool). 
MESSAGE "integer of date is" INTEGER(mydate). 
MESSAGE "integer of handle is" INTEGER(myhdl). 
MESSAGE " ". 
MESSAGE "int64 of integer expression is" INT64(myint). 
MESSAGE "int64 of int64 expression is" INT64(myint64 - 333000000000). 
MESSAGE "int64 of int64 >2gig is" INT64(myint64). 
MESSAGE "int64 of char is" INT64(mychar). 
MESSAGE "int64 of dec is" INT64(mydec). 
MESSAGE "int64 of bool is" INT64(mybool). 
MESSAGE "int64 of date is" INT64(mydate). 
MESSAGE "int64 of handle is" INT64(myhdl). 
MESSAGE " ". 

See also

GET-INT64 function, PUT-INT64 statement, INTEGER function, DECIMAL function, STRING function


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex