home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HomeWare 14
/
HOMEWARE14.bin
/
prog
/
ks94an.arj
/
TO_CHAR.HDR
< prev
next >
Wrap
Text File
|
1994-04-24
|
2KB
|
65 lines
/******************************************************************************
The Klipper Library, for CA-Clipper 5.x
Copyright (c), 1994, Wallace Information Systems Engineering
FUNCTION:
_To_Char( xValue, xFill ) --> cString
PARAMETERS:
xValue : Value to be converted to character type
xFill : Logical - add leading zeros to numerics (Optional, Default = FALSE)
SHORT:
Convert any data type to string equivalent.
DESCRIPTION:
_To_Char() accepts any Clipper data type and returns it's character
equivalent representation.
In the case of Numeric data, spaces are added to the beginning of the
numeric value to pad to the default length. This depends upon the
type numeric it is. Double precision integers occupy 16 places. For
numeric field data, the length is specified in the file structure. If
xFill is passed as TRUE, these leading spaces are filled with ZEROS.
If xFill is passed as a numeric, then numeric data types are stringified
to that length. If the length specified in xFill is less than or equal to
the length of the number being converted, the length of the number is
unaffected:
_To_Char(501,4) = " 501"
_To_Char(501,3) = "501"
_To_Char(501,2) = "501"
When xFill is numeric, nDec can be specified to control the number of
decimal places retained during conversion.
If nDec is not specified, the current SET DECIMALS setting is used.
For Logical data types, the return val is a "Y" or "N".
Finally, (xValue = NIL) returns ""
NOTE:
EXAMPLE:
_To_Char(1001) // "1001"
_To_Char(1001,5) // " 1001"
_To_Char(1001,8) // " 1001"
_To_Char(date()) // "01/01/93"
_To_Char(.F.) // "N"
******************************************************************************/