I am using Lazarus IDE v1.4.4 to do my sch project.
It involves writing data into a .csv, so I tried to use the append function
but when I try to test the program , it shows "Error,Identifier Not Found Add_Name_Edit" in line 56
spent some time figuring it out but still don't have a clue
I created "Add_Name_Edit" on the form as in line 21
would be grateful if someone could help...
unit Unit2;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm2 }
TForm2 = class(TForm)
Add_Department_Box: TComboBox;
Add_Department_Label: TLabel;
Add_Gradyear_Edit: TEdit;
Add_Gradyear_Label: TLabel;
Add_ID_Edit: TEdit;
Add_ID_Label: TLabel;
Add_Name_Edit: TEdit;
Add_Name_Label: TLabel;
Add_Title: TLabel;
Add_Seat_Box: TComboBox;
Add_Seat_Label: TLabel;
Confirm_Button: TButton;
Back_Button: TButton;
procedure Confirm_ButtonClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.lfm}
{ TForm2 }
procedure TForm2.FormCreate(Sender: TObject);
begin
end;
procedure AddData;
var Data:TextFile;
begin
assign(Data,'Data.csv');
append(Data);
write(Data,Add_Name_Edit.text);
Closefile(Data);
end;
procedure TForm2.Confirm_ButtonClick(Sender: TObject);
begin
Showmessage('資料已新增。如要修改資料,請在主選單開啟相關程序。');
Close;
end;
end.