 NTOC()
 Converts the numbers in a digit string into a different number base

 Syntax

     NTOC(<nLONG|cHexLONG>,[<nBase>],[<nLength>],
        [<cPad>]) --> cCharacterstring

 Arguments

     <nLONG|cHexLONG>  Corresponds to a decimal number or hexadecimal
     character string to convert.

     <nBase>  Designates the number system base, from 2 to 36
     (inclusive), to use in the result.  The default is the decimal system,
     base 10.

     <nLength>  Designates the length of the string that results.  The
     maximum length is 255.  The default is the length required for the
     conversion.

     <cPad>  Designates a pad character to pad the string result on the
     left.  The default value is a space.

 Returns

     NTOC() returns a character string that contains the conversion result of
     <nLONG|cHexLONG> into the <nBase> number system.

 Description

     NTOC() converts a decimal number or hexadecimal string into a number
     string.  The result is a number in base <nBase> or, if <nBase> is not
     specified, in base 10.  Use <nLength> to determine the length of the
     result string.  However, if <nLength> is longer than the length
     necessary for the result, the result string is padded on the left with
     spaces or with a character selected with <cPad>.

 Note

       If incompatible parameter combinations are specified, NTOC()
        returns one or more asterisks (*) as a result.

 Examples

       Convert to base 10:

        ? NTOC (60000)                //"60000"
        ? NTOC (60000, 10, 7)         //"    60000"

       Convert to base 2:

        ? NTOC(60000, 2)              // "1110101001100000"
        ? NTOC("FFFF", 2)             // "1111111111111111"
        ? NTOC("30", 2, 8, "0")       // "00110000"

       Convert to base 16:

        ? NTOC(43981, 16)             // "ABCD"

       Convert to base 36:

        ? NTOC(43981, 36, 4)          // "XXP"

       Invalid parameters (overflow):

        ? NTOC("GGGG", 2)             // "*"
        ? NTOC(60000, 10, 3)          // "***"
        ? NTOC(60000, 1, 4)           // "****"




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



 CTON()
 Converts a numeric string into a different base

 Syntax

     CTON(<cNumericstring>,[<nBase>],[<lMode>])
         --> nInteger

 Arguments

     <cNumericstring> Designates a numeric string to convert into a
     number in base <nBase>.

     <nBase>  Designates the number base to use in the conversion.  Can
     be in the range of 2 to 36.  The default is the decimal system, base 10.

     <lMode>  When designated as .T., allows a negative result.  The
     default allows only positive results.

 Returns

     CTON() returns the converted number that corresponds to the string.  The
     values lie in the range of 0 and 65535 or, if <lMode> is .T., in the
     range of -32768 and +32767.

 Description

     CTON() offers a number of ways to covert a number string into numeric
     data format.  Almost any number can be converted, as long as the base
     <nBase>  for the number system lies between 2 and 36.

 Notes

       The <cNumericstring> string is automatically TRIMmed left and
        right.

       If you have invalid parameters or combinations, the function
        returns a value of 0.

 Examples

       Convert to base 10:

        ? CTON("60000")                    // Result:  60000

       Convert to base 2:

        ? CTON("11", 2)                    // Result:  3

        ? CTON("1110101001100000", 2)      // Result:  60000

       Convert to base 16:

        CTON("A", 16)                      // Result:  10

        ? CTON("ABCD", 16)                 // Result:  43981

        ? CTON("FFFF", 16, .T.)            // Result:  -1

       Convert to base 36:

        ? CTON("XXP", 36)                  // Result:  43981


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib is : CT