不懂pascal,现学现卖的写了一小段程序。
unit TestUnit;interface
function div2(a : LongInt; b : LongInt) : LongInt;implementation
function div2(a : LongInt; b : LongInt) : LongInt;
begin
Result := a div b;
if (a mod b) > 0 then
begin
Inc(Result);
end;
end;end.
google:
you have to activate the Delphi or ObjFPC compilation mode.
我也不懂,不过感觉需要
var
Result: LongInt;
我也不懂,
不过怎么感觉和python有点象嘛?
[quote="night_stalker"]我也不懂,不过感觉需要
var
Result: LongInt;
[/quote]
不需要
lz,我在d7里能编译过你的这段代码啊。
好久不写delphi都忘了 :oops:
难道要小写result
难道是版本问题,没有result关键字