主题:一个DLL 编译出错的问题,帮忙看看怎么回事呀,实在搞不清楚[已解决]
源码如下:
library Project2;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
SysUtils,
Classes;
{$R *.res}
function manhourptc(Dia:integer;length:integer):double;stdcall;
var Manhour:double;
begin //以下是普通产品是的调用的数值
case Dia of
0..29:Manhour:=1.02;
30..39:Manhour:= 1.09;
40..49:Manhour:= 1.16;
50..59:Manhour:= 1.2;
60..69:Manhour:= 1.31;
70..79:Manhour:=1.44;
80..89:Manhour:=1.61;
90..99:begin case Length of //当直径在90到99之间时
0..199: Manhour:=1.82; //定额和长度的关系
200..299:Manhour:= 2.07;
else Manhour:=2.41
end;
end;
100..109:begin case Length of
0..199: Manhour:=2.07;
200..300:Manhour:= 2.41;
else Manhour:=3.05
end;
end;
110..119:begin case Length of
0..199: Manhour:=2.41;
200..300:Manhour:= 3.05;
else Manhour:=3.6
end;
end;
120..129: begin case Length of
0..199: Manhour:=3.05;
200..300:Manhour:= 3.6;
else Manhour:=4.02
end;
end;
130..139: begin case Length of
0..199: Manhour:=3.6;
200..300:Manhour:= 4.02;
else Manhour:=4.45
end;
end;
140..149:begin case Length of
0..199: Manhour:=4.45;
200..300:Manhour:= 4.9;
else Manhour:=5.78
end;
end;
150..159:begin case Length of //此处数值原资料不清楚
0..199: Manhour:=4.9;
200..300:Manhour:= 4.9;
else Manhour:=5.78
end;
end;
160..179:begin case Length of
0..199: Manhour:=5.78;
200..300:Manhour:=6.43;
301..400:Manhour:=7.08;
else Manhour:=7.73
end;
end;
else begin case Length of
0..199: Manhour:=6.43;
200..300:Manhour:=7.08;
else Manhour:=7.73
end;
end;
result:=manhour;
end;
exports
manhourptc index 1 name 'manhourptc' ;
begin
end.
编译提示:
[Error] Project2.dpr(88): Statement expected but 'EXPORTS' found
[Warning] Project2.dpr(90): Symbol 'INDEX' is specific to a platform
library Project2;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
SysUtils,
Classes;
{$R *.res}
function manhourptc(Dia:integer;length:integer):double;stdcall;
var Manhour:double;
begin //以下是普通产品是的调用的数值
case Dia of
0..29:Manhour:=1.02;
30..39:Manhour:= 1.09;
40..49:Manhour:= 1.16;
50..59:Manhour:= 1.2;
60..69:Manhour:= 1.31;
70..79:Manhour:=1.44;
80..89:Manhour:=1.61;
90..99:begin case Length of //当直径在90到99之间时
0..199: Manhour:=1.82; //定额和长度的关系
200..299:Manhour:= 2.07;
else Manhour:=2.41
end;
end;
100..109:begin case Length of
0..199: Manhour:=2.07;
200..300:Manhour:= 2.41;
else Manhour:=3.05
end;
end;
110..119:begin case Length of
0..199: Manhour:=2.41;
200..300:Manhour:= 3.05;
else Manhour:=3.6
end;
end;
120..129: begin case Length of
0..199: Manhour:=3.05;
200..300:Manhour:= 3.6;
else Manhour:=4.02
end;
end;
130..139: begin case Length of
0..199: Manhour:=3.6;
200..300:Manhour:= 4.02;
else Manhour:=4.45
end;
end;
140..149:begin case Length of
0..199: Manhour:=4.45;
200..300:Manhour:= 4.9;
else Manhour:=5.78
end;
end;
150..159:begin case Length of //此处数值原资料不清楚
0..199: Manhour:=4.9;
200..300:Manhour:= 4.9;
else Manhour:=5.78
end;
end;
160..179:begin case Length of
0..199: Manhour:=5.78;
200..300:Manhour:=6.43;
301..400:Manhour:=7.08;
else Manhour:=7.73
end;
end;
else begin case Length of
0..199: Manhour:=6.43;
200..300:Manhour:=7.08;
else Manhour:=7.73
end;
end;
result:=manhour;
end;
exports
manhourptc index 1 name 'manhourptc' ;
begin
end.
编译提示:
[Error] Project2.dpr(88): Statement expected but 'EXPORTS' found
[Warning] Project2.dpr(90): Symbol 'INDEX' is specific to a platform