home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / DATABASE / CLMSFLPC.ZIP / bin.bak next >
Encoding:
Text File  |  1993-06-24  |  2.2 KB  |  57 lines

  1. =------------------------------------------=
  2. Microsoft FP Conversion routines for Clipper
  3. =------------------------------------------=
  4.  
  5. Introduction
  6. ------------
  7. This =public domain= module, written for Clipper '87 and greater is
  8. designed to facilitate conversions of numeric data stored in a string
  9. format.
  10.  
  11.  
  12. Reasoning
  13. ---------
  14. You'll find that Microsoft QuickBASIC (tm) stores numeric information
  15. in a format which is quite confusing.  The general Clipper programmer
  16. may wish to read files which were create/modified by a QuickBASIC
  17. program.
  18.  
  19. What's in Here?
  20. ---------------
  21. Four functions are included in this small package, and are quite
  22. fast once compiled.  They are:
  23.  
  24. CVI(<expC>)     expC must be a two byte string which represents an
  25.                 integer value.  The maximum value is 65,792.
  26.  
  27. CV(<espC>)      expC must be a floating-point, any precision string
  28.                 up to 64-bytes in length.  This enables extremely
  29.                 high precision, but will generally be used for four
  30.                 and eight byte strings.
  31.  
  32.                 CV() replaces CVS() and CVD() in QuickBASIC.  In
  33.                 addition, CV() uses two additional modules, these
  34.                 being binary/decimal conversion routines.
  35.  
  36. BIN2DEC(<expC>)
  37.                 expC must be a string representing a binary number,
  38.                 consisting of ones and zeros.  It may also consist
  39.                 of a decimal point and the fractional portion, which
  40.                 represents the value beyond the decimal point.
  41.  
  42.                 example:  bin2dec("10001000.101") == 136.625
  43.  
  44. DEC2BIN(<expV>,[<expN>])
  45.                 expV must be a value within limits of conversion to
  46.                 binary of the length desired.  The default length is
  47.                 64-bits.
  48.  
  49.                 example:  dec2bin(235,8) == 11101011
  50.                           dec2bin(235.62,25) == 00011101011.1001111010111
  51.  
  52. All that's required is to link BIN.OBJ (compiled from Clipper) with
  53. your program, and call the routines as specified above.
  54.  
  55. Anyway, enjoy this little file.  Many thanks to those who helped me
  56. understand exactly what is going on inside this funny strings...
  57.