function 和procedure的区别就是一个有返回值(函数)一个没有返回值(过程) 例: procedure SetFunction(AFunction:TTeeFunction); virtual; function Calc(X, Y: Integer): Integer; begin ... end; type TFunction = function(X, Y: Integer): Integer; const MyFunction: TFunction = Calc;Given these declarations, you can use the procedural constant MyFunction in a function call:I := MyFunction(5, 7)You can also assign the value nil to a procedural constant. Delphi 有哪些数据类型,比较常见的常用的 Integer.char.double..很多啊~
介意老兄买本delphi5 开发人员指南看! 经典!
procedure = vb里面的 Sub 是不能返回的 function =vb里面的 function比如 一段Vb代码 Function Sum(a as integer,b as integer) as integer Sum=a+b End Function 翻译成Delphi是 function sum(a:integer;b:integer):integer; begin result:=a+b; end;而Sub和procedure的例子如下 Sub Msg(str,title) msgbox str,,title End Subprocedure Msg(str); begin messagebox(str); end;vb调用是 如果不返回,必须用Call 例如 Call Msg("我","标题") 或者 Msg "我","标题" delphi 没这个要求 全部是 msg('啊啊');
//===================================================================================
//function有返回值,procedure没有返回值
//===================================================================================
Delphi 有哪些数据类型,比较常见的常用的。
//===================================================================================
//随便找本delphi的书都有介绍
//===================================================================================
是否有API手册之类的可以速查的东东可帮助学习?
//===================================================================================
//delphi的帮助
//===================================================================================
需要最初级的相关入门资料,请不吝赐教。感谢。
//===================================================================================
//我用的是Object Pascal参考手册
//===================================================================================
区别function就是一个必须返回值,procedure不用返回值!
推荐delphi 6开发人员指南,里面有你要的所有东西。
至于API函数,大概浏览一下,用到的时候再查也可以!
procedure是过程function照样引用窗体中的任何部件的属性或方法,只要你写上form1.xxx
例:
procedure SetFunction(AFunction:TTeeFunction); virtual;
function Calc(X, Y: Integer): Integer;
begin
...
end;
type TFunction = function(X, Y: Integer): Integer;
const MyFunction: TFunction = Calc;Given these declarations, you can use the procedural constant MyFunction in a function call:I := MyFunction(5, 7)You can also assign the value nil to a procedural constant.
Delphi 有哪些数据类型,比较常见的常用的
Integer.char.double..很多啊~
经典!
是不能返回的
function =vb里面的 function比如 一段Vb代码
Function Sum(a as integer,b as integer) as integer
Sum=a+b
End Function
翻译成Delphi是
function sum(a:integer;b:integer):integer;
begin
result:=a+b;
end;而Sub和procedure的例子如下
Sub Msg(str,title)
msgbox str,,title
End Subprocedure Msg(str);
begin
messagebox(str);
end;vb调用是 如果不返回,必须用Call
例如 Call Msg("我","标题")
或者 Msg "我","标题"
delphi 没这个要求
全部是 msg('啊啊');