{@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
The purchaser of these procedures and functions may include them in COMPILED
programs freely, but may not sell or give away the source text.

driver for function HEX(num: integer):HexString;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
{$I hexfunct.lib}
{$I getintgr.lib}
var
  num_to_convert : integer;
begin
  repeat
    Write('Enter an integer :');
    num_to_convert := GetInteger(-MaxInt,MaxInt); { NOTE: MaxInt = 32,767.
                                                    TURBO theoretically uses
                                                    integers from -32,768 to
                                                    32,767, but in working
                                                    fact, exactly -32,768
                                                    is not available as an
                                                    integer.  It can, however,
                                                    be represented as $8000. }

    WriteLn;
    WriteLn('Hex for ',num_to_convert,' is ',HEX(num_to_convert));
  until num_to_convert = 0;
end.