CONVERSION

Name

CONVERSION -- 

Function

nNumber             BIN2I(<cSignedInt>)
nNumber             BIN2L(<cSignedInt>)
nNumber             BIN2W(<cUnsignedInt>)
<nValue>            DSTRTON(<sString>)
<nValue>            FSTRTON(<sString>)
cBitPattern         FT_BYT2BIT( <cByte> )
cHexValue           FT_BYT2HEX( cByte )
<cNumE>             FT_D2E( <nDec>, <nPrecision> )
cBinaryNumber       FT_DEC2BIN( <nNum> )
<nDec>              FT_E2D( <cNumE> )
<cPrinterFormat>    FT_ESCCODE( <cASCII> )
nDecNum             FT_HEX2DEC( <cHexNum> )
cColor              FT_INVCLR( [ <cDsrdColor> ] )
cWords              FT_NTOW( <nNumber> )
cCompressed         FT_SQZN( <nValue> [, <nSize> [, <nDecimals> ] ] )
nValue              FT_UNSQZN( <cCompressed>, <nSize> [, <nDecimals> ] )
xResult             FT_XTOY( <xValueToConvert>, <cTypeToConvertTo> ; [, <lWantYesNo> ] )
<sStr>              HASHNAME(<nHashCode>)
<nHashCode>         HASHSTR(<sStr>)
cBinaryInteger      I2BIN(<nInteger>)
cBinaryInteger      L2BIN(<nExp>)
<vData>             STR2VAR(<sUucodeStr>)
<sUucodeStr>        VAR2STR(<vData>)

Description

Function FT_BYT2BIT()

 FT_BYT2BIT( <cByte> ) --> cBitPattern

Can be used to show results of bit manipulation, both before and after. Binary representation follows right-to-left convention of bit position numbering, 0 through 7. Space between high and low nibbles for clarity and easy comparison to hexadecimal notation.

This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .C or .ASM versions and use the Clipper Extend system.

Function FT_BYT2HEX()

 FT_BYT2HEX( cByte ) --> cHexValue

Can be used to show results of bit manipulation, both before and after.

This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .C or .ASM versions and use the Clipper Extend system.

Function FT_D2E()

 FT_D2E( <nDec>, <nPrecision> ) --> <cNumE>

Given a decimal number and the desired precision, a string representing the equivalent in scientific notation is returned.

Function FT_DEC2BIN()

 FT_DEC2BIN( <nNum> ) --> cBinaryNumber

This function can be used in conjunction with any bit-wise operations.

Function FT_E2D()

 FT_E2D( <cNumE> ) --> <nDec>

Given a string in the format x.yEz, the decimal equivalent is returned.

Function FT_ESCCODE()

 FT_ESCCODE( <cASCII> ) --> <cPrinterFormat>

This function is useful for allowing the user to enter printer control codes in Lotus-style ASCII format, and then having this function convert that code to the format that the printer needs to receive.

Function FT_HEX2DEC()

 FT_HEX2DEC( <cHexNum> ) --> nDecNum

Converts a hexadecimal number to a BASE 10 decimal number. Useful for using FT_INT86().

Function FT_INVCLR()

 FT_INVCLR( [ <cDsrdColor> ] ) --> cColor

This function inverts a passed color (in the Clipper format: ??/??), e.g., "W/N" is converted to "N/W".

Function FT_NTOW()

 FT_NTOW( <nNumber> ) --> cWords

Translates numeric input to a text string.

FT_NTOW is intended to be used with integers only. Since I don't know what your application will be, I can't assume the type of fraction you want returned (ninety nine cents, 99/100, .99, etc). If you want the fraction in words, just pass it as an integer.

Do not pass a negative number! Handle negative numbers any way you need to in your code. (ie: CR, DB, Negative, Minus, etc.)

Also, numeric 0 is returned as a null string. You will need to make a decision how to output it (zero dollars, no dollars, etc).

Function FT_SQZN()

 FT_SQZN( <nValue> [, <nSize> [, <nDecimals> ] ] ) --> cCompressed

The FT_SQZN function allows a numeric value to be compressed when stored in the database. The compression is 50% the storage space of the original number. The companion function, FT_UNSQZN returns the original number from the compressed string.

Function FT_UNSQZN()

 FT_UNSQZN( <cCompressed>, <nSize> [, <nDecimals> ] ) --> nValue

The FT_UNSQZN function returns the numeric value from the compressed string. The compression is 50% the storage space of the original number. The original number must have been compressed using the FT_SQZN() function.

This function, along with FT_SQZN() can be used to reduce disk storage requirements for numeric fields in a database file.

Function FT_XTOY()

 FT_XTOY( <xValueToConvert>, <cTypeToConvertTo> ;
 [, <lWantYesNo> ] ) --> xResult

This function converts a value of character, date, numeric, logical, array or code block type to any of the other type. While it is guaranteed to return a value of the correct type, that value may not be meaningful (i.e., converting from a code block returns an EMPTY() value of the desired type).