Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.39 KB | None | 0 0
  1. unit it_interface;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  9.   Menus, ExtCtrls, Buttons, Process, LCLType, ActnList;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     Button1: TButton;
  17.     Button2: TButton;
  18.     Button3: TButton;
  19.     Edit2: TEdit;
  20.     Edit3: TEdit;
  21.     Exit1: TButton;
  22.     Edit1: TEdit;
  23.     Label1: TLabel;
  24.     procedure Button1Click(Sender: TObject);
  25.     procedure Button2Click(Sender: TObject);
  26.     procedure Button3Click(Sender: TObject);
  27.   private
  28.  
  29.   public
  30.  
  31.   end;
  32. const
  33.   C_FNAME = 'textfile.txt';
  34.   Cnt: Integer = 1;
  35.   Cnt_1: Integer =1;
  36.  
  37. var
  38.   Form1: TForm1;
  39.   tfOut: Textfile;
  40.   RunProgram: TProcess;
  41.   //UserString: string;
  42.  
  43. implementation
  44.  
  45. {$R *.lfm}
  46.  
  47. { TForm1 }
  48.  
  49. procedure TForm1.Button1Click(Sender: TObject);
  50. begin
  51.    inc(Cnt);
  52.    Edit1.Text:=IntToStr(Cnt);
  53. end;
  54.  
  55. procedure TForm1.Button2Click(Sender: TObject);
  56. begin
  57.   Close;
  58. end;
  59.  
  60. procedure TForm1.Button3Click(Sender: TObject);
  61. begin
  62.   Edit1.Text:=Edit2.Text;
  63.   Cnt_1:=StrToInt(Edit2.Text);
  64.   Edit3.Text:=IntToStr(Cnt_1);
  65.   AssignFile(tfOut,C_FNAME);
  66.   rewrite(tfOut);
  67.   Write(tfOut, Cnt_1);
  68.   CloseFile(tfOut);
  69.   RunProgram := TProcess.Create(nil);
  70.   RunProgram.CommandLine := 'python3 ./bestemmelse_af_rod_med_textfil_og_graf_v1.py';
  71.   RunProgram.Execute;
  72.   RunProgram.Free;
  73. end;
  74.  
  75.  
  76.  
  77. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement