home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / MADTRB4.ZIP / HEXFUNCT.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1984-12-19  |  1.2 KB  |  27 lines

  1. {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
  2. The purchaser of these procedures and functions may include them in COMPILED
  3. programs freely, but may not sell or give away the source text.
  4.  
  5. driver for function HEX(num: integer):HexString;
  6.  
  7. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
  8. {$I hexfunct.lib}
  9. {$I getintgr.lib}
  10. var
  11.   num_to_convert : integer;
  12. begin
  13.   repeat
  14.     Write('Enter an integer :');
  15.     num_to_convert := GetInteger(-MaxInt,MaxInt); { NOTE: MaxInt = 32,767.
  16.                                                     TURBO theoretically uses
  17.                                                     integers from -32,768 to
  18.                                                     32,767, but in working
  19.                                                     fact, exactly -32,768
  20.                                                     is not available as an
  21.                                                     integer.  It can, however,
  22.                                                     be represented as $8000. }
  23.  
  24.     WriteLn;
  25.     WriteLn('Hex for ',num_to_convert,' is ',HEX(num_to_convert));
  26.   until num_to_convert = 0;
  27. end.