home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / PASCAL / QP_CONVR.ZIP / CONVERT.DOC next >
Encoding:
Text File  |  1989-11-05  |  1.5 KB  |  36 lines

  1. CONVERT.QPU     by 2LT Michael P. Kelly for QuickPascal v1.0
  2.  
  3.     Handy Quick Pascal Unit with which you can convert various data types
  4. to other data types.  Being a C programmer, I was frustrated by the lack of
  5. conversion available and strict data typing.  It is very nice to protect you
  6. from your own mistakes, but sometimes you must code dangerously to get
  7. something done.
  8.  
  9.         I hope these routines will eliminate the annoying error messages that
  10. you get when you are using two different type operands.  I am still working
  11. on a real-integer conversion.  Any suggestions can be sent to me at my
  12. CompuServe address, 73747,420.  Maybe the solution to some of these problems
  13. is right in the on-line help, but I have grown tired of searching endless
  14. avenues of on-line help.  In my opinion, they should have stuck to manuals
  15. like Borland.
  16.  
  17. Functions:
  18.  
  19. FUNCTION INT2CHAR(VALUE : INTEGER) : CHAR;
  20. FUNCTION CHAR2INT(VALUE : CHAR) : INTEGER;
  21. FUNCTION CHAR2BYTE(VALUE : CHAR) : BYTE;
  22. FUNCTION BYTE2CHAR(VALUE : BYTE) : CHAR;
  23. FUNCTION BYTE2INT(VALUE : BYTE) : INTEGER;
  24. FUNCTION INT2BYTE(VALUE : INTEGER) : BYTE;
  25. FUNCTION CHAR2SHORT(VALUE : CHAR) : SHORTINT;
  26. FUNCTION SHORT2CHAR(VALUE : SHORTINT) : CHAR;
  27.  
  28. When converting from signed data types to unsigned data types, such as integer
  29. to character, the integer must have a positive value otherwise the resulting
  30. return value will be 0.
  31.  
  32.  
  33. Reach me also at:       mkelly@galaxy.afit.af.mil
  34.                         mkelly@blackbird.afit.af.mil
  35.  
  36.