home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / autorun / prdi.~pa < prev    next >
Encoding:
Text File  |  1996-02-05  |  1.2 KB  |  69 lines

  1. unit Prdi;
  2.  
  3. interface
  4.  
  5. uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,
  6.   StdCtrls, ExtCtrls,Printers;
  7.  
  8. type
  9.   TpriDial = class(TForm)
  10.     OKBtn: TBitBtn;
  11.     CancelBtn: TBitBtn;
  12.     Bevel1: TBevel;
  13.     c1: TRadioButton;
  14.     c2: TRadioButton;
  15.     c3: TRadioButton;
  16.     Label1: TLabel;
  17.     procedure CancelBtnClick(Sender: TObject);
  18.     procedure OKBtnClick(Sender: TObject);
  19.   private
  20.     { Private declarations }
  21.   public
  22.     { Public declarations }
  23.   end;
  24.  
  25. var
  26.   priDial: TpriDial;
  27.  
  28. implementation
  29.  
  30. {$R *.DFM}
  31.  
  32. procedure TpriDial.CancelBtnClick(Sender: TObject);
  33. begin
  34. close;
  35. end;
  36.  
  37. procedure TpriDial.OKBtnClick(Sender: TObject);
  38. var
  39.    f,myfile:Textfile;
  40.    str:String;
  41.    col,i:integer;
  42. begin
  43.      if c1.checked then col:=1;
  44.      if c2.checked then col:=2;
  45.      if c3.checked then col:=3;
  46.      AssignFile(f,'c:\temp.ben');
  47.      Reset(f);
  48.      AssignPrn(MyFile);
  49.      Rewrite(MyFile);
  50.      writeln(myfile,' ');
  51.      While not Eof(f) do
  52.      begin
  53.      for i:=1 to col do
  54.      begin
  55.      try
  56.      readln(f,str);
  57.      Write(MyFile, str:20);
  58.      finally
  59.      end;
  60.      end;
  61.      writeln(Myfile);
  62.      end;
  63.      closefile(f);
  64.      System.CloseFile(MyFile);
  65.  
  66. end;
  67.  
  68. end.
  69.