TTOC( ) Function Example

The following example creates a Datetime type variable named gtDtime. TYPE( ) displays T, indicating the variable is a Datetime type. TTOC( ) is used to convert the variable to a character type, and TYPE( ) now displays C, indicating the  variable is a character type after the conversion.

STORE DATETIME( ) TO gtDtime  && Creates a Datetime type memory variable
CLEAR
? "gtDtime is type: "  
?? TYPE('gtDtime')  && Displays T, Datetime type value

gtDtime = TTOC(gtDtime)     &&  Converts gtDtime to a character value
? "gtDtime is now type: "  
?? TYPE('gtDtime')  && Displays C, character type value