帮忙看看这个无窗体的单元中的错误!
unit Unit_public;
interface
function autoinde(var SerialNumber:string):string;
implementation
{$R *.DFM}
function autoinde(var SerialNumber:string):string;
var
//存储编号
year,month,day:word;
Str_month:string;
Str_day:string;
begin
decodedate(now,year,month,day);
if month<10 then//如果月份的数据的位数为1则在数字的前面加0
begin
Str_month:='0'+inttostr(month);
end;
if day<10 then//如果日期的数据的位数为1则在数字的前面加0
begin
Str_day:='0'+inttostr(day);
end;
randomize;
SerialNumber:=inttostr(year)+Str_month+Str_day+copy(floattostr(random),3,4);
end;
end.
===============
备注:我在一个公共的无窗体的单元中写个随机编号的函数供其他的单元调用,但老是出错,帮忙看看!顺便提点意见~~
错误信息:
[Warning] Unit_public.pas(6): File not found: 'Unit_public.DFM'
[Error] Unit_public.pas(14): Undeclared identifier: 'decodedate'
[Error] Unit_public.pas(14): Undeclared identifier: 'now'
[Error] Unit_public.pas(17): Undeclared identifier: 'inttostr'
[Error] Unit_public.pas(24): Undeclared identifier: 'floattostr'
[Error] Unit_public.pas(24): Incompatible types
[Fatal Error] qunguan.dpr(83): Could not compile used unit 'unit\Unit_public.pas'
最好能说一下错误的原因,谢谢!!!