home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / fortran / library / comline / p_cline.pas < prev    next >
Pascal/Delphi Source File  |  1991-07-01  |  2KB  |  54 lines

  1. { =======================================================================
  2.   
  3.     PROGRAM FILE:  P_CLINE.PAS
  4.  
  5.     DATE:  July 1, 1991  
  6.  
  7.     VERSION:  1.01                      REVISION DATE:              
  8.  
  9.     AUTHOR:  Scott D. Heavner 
  10.  
  11.     LANGUAGE: Turbo Pascal 5.0
  12.  
  13.     COPYRIGHT:  1991, Scott D. Heavner
  14.  
  15.   ======================================================================
  16.  
  17.     DESCRIPTION:  P_CLINE is an example of how to use the COMLINE.ASM
  18.                   subroutine.  The user should determine what flags and
  19.                   such he wishes to check for, and incorporate his own
  20.                   code.  This can be placed as part of a subroutine or
  21.                   in the main program.
  22.  
  23.  ==================================================================== }
  24. program Pascal_Test;
  25. {$L COMLINE}
  26. {$F+}                            {Force far calls for FORTRAN procedure}
  27.  
  28. type                             {Define character*128 array type}
  29.  Str = array [1..128] of char;
  30.  
  31. var
  32.  Inp : Str;
  33.  i, len: integer;
  34.  
  35.                                  {Define EXTERNAL fortran procedure}
  36. procedure CLINE(cin: Str); external;
  37.  
  38. begin
  39.   CLINE(Inp);                    {Call FORTRAN}
  40.   len := ORD(Inp[1]);            {Get length of input (in first character)}
  41.   writeln ('Length = ',len);
  42.   len := len + 1;                {Increase length to define new input}
  43.   for i := 2 to 128 do           {Display string and add LF with CR}
  44.    begin
  45.      write(Inp[i]);
  46.      if (Inp[i]=chr(13)) then writeln;
  47.      if (i=len) then             {If past new input, tell user}
  48.        begin
  49.          writeln;
  50.          writeln('Begin Previous data . . .');
  51.        end
  52.    end    
  53. end.
  54.