Harbour Conversion Functions

Conversion Functions

Bin2I Convert signed short encoded bytes into Harbour numeric
Bin2L Convert signed long encoded bytes into Harbour numeric
Bin2U Convert unsigned long encoded bytes into Harbour numeric
Bin2W Convert unsigned short encoded bytes into Harbour numeric
BitToC Converts position-dependent bits into characters
BinToDec Converts a Binary Value to Decimal
CToBit Converts a character string into a bit pattern
CToF Converts a special 8-byte string into a floating point number
CToN Converts a numeric string into a different base
DecToBin Converts a Decimal Value to Binary
DecToHexa Converts a Decimal Value to Hexa
DecToOctal Converts a Decimal Value to Octal
Fahrenheit Temperature conversion Celsius to Fahrenheit
FToC Converts a floating point number into a special 8-byte string
HexaToDec Converts a Hexa Value to Decimal
I2Bin Convert Harbour numeric into signed short encoded bytes
L2Bin Convert Harbour numeric into signed long encoded bytes
NToC Converts the numbers in a digit string into a different number base
OctalToDec Converts a Octal Value to Decimal
U2Bin Convert Harbour numeric into unsigned long encoded bytes
W2Bin Convert Harbour numeric into unsigned short encoded bytes
Word Converts double to integer values
XTOC Convert an expression to character type string

SP_WGT_MEAS

WGT_MEAS()

  Short:
  ------
  WGT_MEAS() A Weights and Measures conversion metafunction

  Returns:
  --------
  Nothing

  Syntax:
  -------
  WGT_MEAS()

  Description:
  ------------
  WGT_MEAS() is a menu driven Weights and Measure
  conversion utility, which supports many types of conversions.

  Examples:
  ---------
   WGT_MEAS()

  Source:
  -------
  S_MEAS.PRG

 

FT_XTOY

FT_XTOY()
 Convert from any data type to any other data type

 Syntax

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

 Arguments

     <xValueToConvert> is the value to convert.

     <cTypeToConvertTo> is the type of value to convert to
     ("C","D","L","N","A" or "B").

     <lWantYesNo> is a logical to signal if 'Y' or 'N' is to be returned
     if Converting a logical, otherwise '.T.' or '.F.' will be returned
     for logicals.

 Returns

     The original value converted to the new type.

 Description

     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).

 Examples

     nNumericValue := FT_XTOY(cInputValue, "N")
     IF (FT_XTOY(nInputValue, "L"))

 Source: ANY2ANY.PRG

 Author: David Husnian

 

FT_UNSQZN

FT_UNSQZN()
 Uncompress a numeric compressed by FT_SQZN()
------------------------------------------------------------------------------

 Syntax

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

 Arguments

     <cCompressed>  - Compressed string, obtained from FT_SQZN()

     <nSize>        - Size of numeric field

     <nDecimals>    - Optional number of decimal places

 Returns

     nValue       - Uncompressed numeric value

 Description

    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.

 Examples

    mcust_id := FT_UNSQZN(TRANS->cust_id,8),;
    mamount  := FT_UNSQZN(TRANS->amount,12,2)

 Source: SQZN.PRG

 Author: Joseph D. Booth, Sr.

See Also: FT_SQZN()

FT_STOD

FT_STOD()
 Convert a date string to a Clipper date data type

 Syntax

      FT_STOD( <cDateStr> ) -> dDateType

 Arguments

     <cDateStr> is a Clipper string in the format "CCYYMMDD".

 Returns

     A Clipper date type.

 Description

     This function allows the programmer to hard code a date into the
     program without knowing what the current date type is.  This
     function is the converse of the Clipper DTOS() function.

 Examples

     LOCAL dMyDate
     dMyDate := FT_STOD( "19901127" )

 Source: STOD.C

 Author: Clayton Neff