unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Grids;type
MethodFileType = file of TMethod;
TRecFileForm = class(TForm)
OpenButton: TButton;
NewButton: TButton;
CloseButton: TButton;
ExitButton: TButton;
AddButton: TButton;
ModifyButton: TButton;
DeleteButton: TButton;
CalcuButton: TButton;
Label1: TLabel;
Label2: TLabel;
StringGrid1: TStringGrid;
LabeledEdit1: TLabeledEdit;
OpenDialog1: TOpenDialog;
procedure OpenButtonClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
RecFileForm: TRecFileForm;
FileName:string[70];
MethodFile:MethodFileType;
Count:integer;
FileOpened:Boolean;
implementation{$R *.dfm}procedure TRecFileForm.OpenButtonClick(Sender: TObject);
begin
if OpenDialog1.Execute then
FileName:=OpenDialog1.FileName
else
exit;
AssignFile(MethodFile,Filename);
try
Reset(MethodFile);
FileOpened:=True;
except
On EInOutError do
begin
try
if FileExists(FileName)=False then
begin
ReWrite(MethodFile);
FileOpened:=True;
end
else
begin
FileOpened:=False;
MessageDlg('文件不能打开',mtWarning,[mbOK],0);
end;
except
On EInOutError do
begin
FileOpened:=False;
MessageDlg('文件不能创建',mtWarning,[mbOK],0);
end;
end;
end;
end;
if FileOpened=False then exit;
Count:=FileSize(MethodFile);
if Count>0 then ChangGrid;//出错//
RecFileForm.Caption:=FormCaption+' -- '+FileName;//出错//
NewButton.Enabled:=False;
OpenButton.Enabled:=False;
CloseButton.Enabled:=True;
end;end.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Grids;type
MethodFileType = file of TMethod;
TRecFileForm = class(TForm)
OpenButton: TButton;
NewButton: TButton;
CloseButton: TButton;
ExitButton: TButton;
AddButton: TButton;
ModifyButton: TButton;
DeleteButton: TButton;
CalcuButton: TButton;
Label1: TLabel;
Label2: TLabel;
StringGrid1: TStringGrid;
LabeledEdit1: TLabeledEdit;
OpenDialog1: TOpenDialog;
procedure OpenButtonClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
RecFileForm: TRecFileForm;
FileName:string[70];
MethodFile:MethodFileType;
Count:integer;
FileOpened:Boolean;
implementation{$R *.dfm}procedure TRecFileForm.OpenButtonClick(Sender: TObject);
begin
if OpenDialog1.Execute then
FileName:=OpenDialog1.FileName
else
exit;
AssignFile(MethodFile,Filename);
try
Reset(MethodFile);
FileOpened:=True;
except
On EInOutError do
begin
try
if FileExists(FileName)=False then
begin
ReWrite(MethodFile);
FileOpened:=True;
end
else
begin
FileOpened:=False;
MessageDlg('文件不能打开',mtWarning,[mbOK],0);
end;
except
On EInOutError do
begin
FileOpened:=False;
MessageDlg('文件不能创建',mtWarning,[mbOK],0);
end;
end;
end;
end;
if FileOpened=False then exit;
Count:=FileSize(MethodFile);
if Count>0 then ChangGrid;//出错//
RecFileForm.Caption:=FormCaption+' -- '+FileName;//出错//
NewButton.Enabled:=False;
OpenButton.Enabled:=False;
CloseButton.Enabled:=True;
end;end.
解决方案 »
- 下载了一个QUICKREPORT4.05,请问怎样安装到delphi里呢
- 我现在在昆明,十月份以后打算去深圳,熟悉深圳的朋友给点意见??
- 怎样让socket不断发数阿?
- 如何获得打印机状态?
- 请大家帮忙!TDataSet.OnCalcFields如何触发???
- 高分求怎样用table1的记录来动态建立mainMenu中n50下的子菜单呢?(UP有分)
- 怎样将treeview的一个节点和它的所有子节点copy到另一节点下,不是拖动,最好有原码,马上给分!
- 单头对单身的例子。
- 当我把家里做的一软件拷到单位,然后编译时发生如下错误:
- 有知道如河在FROM的任意位置放置Menu的吗?
- 关于dbedit绑定数据库
- delphi查询access时,如何判断时间?
RecFileForm.Caption:=FormCaption+' -- '+FileName;//出错//
ChangGrid;//出错// 是你自己定义的过程吧,定义过程也不能随便哦Type区:
procedure ChangGrid();
implementation:
procedure TForm1.ChangGrid(); //要加类名