home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / tptools.zip / FIRSTED.ZIP / MESSAGE.PAS < prev    next >
Pascal/Delphi Source File  |  1987-12-21  |  1KB  |  50 lines

  1. {                          MESSAGE.PAS
  2.                              ED 4.0
  3.              Copyright (c) 1985, 87 by Borland International, Inc.            }
  4.  
  5. {$I-}
  6. {$R-}
  7. {$S-}
  8. {$V-}
  9. {$D-}
  10.  
  11. unit Message;
  12.   {-Initialize and return messages used by editor}
  13.  
  14. interface
  15.  
  16. function EdGetMessage(Msgno : Integer) : string;
  17.   {-Get message from packed message buffer or return number to caller}
  18.  
  19.   {==============================================================================}
  20.  
  21. implementation
  22.  
  23.   {The machine code contains embedded message strings}
  24.   {To compile FirstEd: use either EDMESG.OBJ or MSMESG.OBJ}
  25.   {To compile MicroStar: MSMESG.OBJ is required}
  26.   {Use EDMESG to reduce size of FirstEd}
  27.   {$L MSMESG}
  28.  
  29.   function EdMessagePtr(Msgno : Integer) : Pointer; external;
  30.   {-Return a pointer to the message string, nil if not available}
  31.  
  32.   function EdGetMessage(Msgno : Integer) : string;
  33.     {-Get message from packed message buffer or return number to caller}
  34.   var
  35.     P : Pointer;
  36.     St : string;
  37.  
  38.   begin                      {EdGetMessage}
  39.     P := EdMessagePtr(Msgno);
  40.     if P = nil then begin
  41.       {String not available, return the error number}
  42.       Str(Msgno, St);
  43.       St := ' Message '+St;
  44.     end else
  45.       Move(P^, St, Succ(Byte(P^)));
  46.     EdGetMessage := St+' ';
  47.   end;                       {EdGetMessage}
  48.  
  49. end.
  50.