我的一个过程调用出错!一定给分!
implementation
procedure addrecord (rec_num :integer ; project, card_type , card_me , exch_id , yearstring, monthstring : string );
var
pre_year,pre_month :string;
cqjc_sl,cqjc_je : integer;
begin
if (monthstring='01') then
begin
pre_month:='12';
pre_year:=inttostr(strtoint(yearstring)-1);
end
else
begin
pre_month:=inttostr(strtoint(monthstring)-1);
pre_year:=yearstring;
end;
messagedlg('ok, the month has changed!' , mtinformation,[mbok],0);
form1.query1.close;
form1.query1.sql.Clear;
form1.query1.sql.add('select cqjc_sl ,cqjc_je from exch_rep_month where rec_num=:rec_num yearsting=:yearstring and monthstring=:monthstring and exch_id=:exch_id');
form1.query1.parambyname('rec_num').asinteger:=rec_num;
form1.query1.parambyname('exch_id').asstring:=exch_id ;
form1.query1.parambyname('monthstring').asstring:=pre_month;
form1.Query1.open;
cqjc_sl:=form1.query1.fieldbyname('cqjc_sl').asinteger;
cqjc_je:=form1.query1.fieldbyname('cqjc_je').asinteger;
messagedlg('ok, the data has been selected',mtinformation ,[mbok],0);
form1.edit1.text:=inttostr(cqjc_sl);
form1.edit2.text:=inttostr(cqjc_je);
end;
{$R *.DFM}
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
table1.active:=true;
table2.active:=true;
table3.active:=true;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
addrecord(2,'20010','200','10','825','2001','05');
end;
运行期间包错的代码是:
project project1.exe raised exception class edbengineerror with
message ' invalid use of keyword .
token : yearstring=?
line number :1' process stopped use step or run to continue!
我已经对YESRSTRING赋值了呀!为什么?
请讲清楚原因,一定给分的·!