home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / LANGUAGS / PASCAL / XYDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  2000-06-30  |  1KB  |  46 lines

  1. program xydemo;  { Demo of XYPLOT }
  2.  
  3. {
  4.     Sample SUBMIT File for Compiling this program with the libraries
  5.         XYPLOT, TRANCEND, FPREALS, and PASLIB --
  6.  
  7. mtplus xydemo $$oa ea v
  8. linkmt xydemo,xyplot,a:trancend,a:fpreals,a:paslib/s
  9.  
  10. }
  11.  
  12. type
  13.     rarray = array [1..200] of real;
  14.     str = string[20];
  15. var
  16.     i : integer;
  17.     theta, r : real;
  18.     x, y : rarray;
  19.     dev : str;
  20.  
  21. external function xyplot (dev1 : str; ndata, nsx, nsy, nnp : integer;
  22.     x, y : rarray) : integer;
  23.  
  24. begin { Test }
  25.     writeln('XYDEMO:  Demo Program of XYPLOT Subroutine');
  26.     writeln('Output Device Options are:');
  27.     writeln('    CON:    = Console');
  28.     writeln('    LST:    = Printer');
  29.     writeln('    <File>    = Disk File, Like P.PLT or A:P');
  30.     write  ('Option -- '); readln(dev);
  31.  
  32.     writeln('XYDEMO:  Computing --');
  33.     for i:=1 to 90 do begin
  34.         write('.');
  35.         if (i mod 45) = 0 then writeln;
  36.         theta := (i-1) * 4 * 3.14159 / 180;
  37.         r := cos (2 * theta);
  38.         x[i] := r * 50 * cos(theta);
  39.         y[i] := r * 50 * sin(theta);
  40.     end;
  41.     writeln('XYDEMO:  Plotting --');
  42.     if 0 <> xyplot (dev, 90, 50, 50, 100, x, y) then
  43.         writeln('XYDEMO:  Error in Outputting File');
  44.     writeln('XYDEMO:  Test Complete');
  45. end.
  46.