S
swan
Unregistered / Unconfirmed
GUEST, unregistred user!
我有一个delphi程序,想变成java application.据说有一个软件能
够做到这一点是吗?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit3: TEdit;
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit2: TEdit;
Edit4: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
a:string[40] ;
b:Integer;
c:double;
myfile:Text ;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
//here we get the integer,the string,thedo
uble
//we need write it into the file
a:='';b:=0;c:=0;
if(edit1.text<>'')
then
a:=Edit1.Text;
if(edit2.text<>'')
then
b:=StrToInt(Edit2.Text);
if(edit3.text<>'')
then
if(edit4.text<>'')
then
c:=StrToInt(Edit3.text)+0.01*StrToInt(Edit4.text);
//we write the information into our file data.txt
writeln(myfile,a);
writeln(myfile,b);
writeln(myfile,c);
//below is to clear the edit
//and so begin
the next time inputting
Edit1.clear;
Edit2.clear;
Edit3.Clear;
Edit4.Clear;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
AssignFile(myfile,'c:/data.txt');
Reset(myfile);
Rewrite(myfile);
end;
procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
CloseFile(myfile);
end;
end.