Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit4;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, ExtDlgs, Shellapi,FileCtrl;
- type
- TForm4 = class(TForm)
- Memo1: TMemo;
- Button1: TButton;
- Button2: TButton;
- Button4: TButton;
- OpenDialog1: TOpenDialog;
- SaveDialog1: TSaveDialog;
- procedure Button4Click(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- private
- { Private-Deklarationen }
- public
- { Public-Deklarationen }
- end;
- var
- Form4: TForm4;
- implementation
- {$R *.dfm}
- procedure TForm4.Button1Click(Sender: TObject);
- var sou : Pwidechar;
- sou2 : widestring;
- begin
- new(sou);
- if savedialog1.Execute then
- begin
- Memo1.Lines.SaveToFile(savedialog1.FileName + '.java');
- sou2 := ExtractFilePath(SaveDialog1.FileName);
- sou := Pwidechar(sou2);
- end;
- ShellExecute(Application.Handle, 'open', 'C:\Windows\System32\cmd.exe', nil, sou , SW_SHOWNORMAL);
- dispose(sou);
- end;
- procedure TForm4.Button4Click(Sender: TObject);
- begin
- if opendialog1.Execute then Memo1.Lines.LoadFromFile(opendialog1.FileName);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement