|
|
导航: |
论坛 -> DELPHI技术
斑竹:liumazi,sephil |
|
作者: |
|
2004/2/13 14:29:51 |
标题: |
|
加入我的收藏 |
楼主: |
…… 被禁用帐号,帖子内容自动屏蔽! ……
----------------------------------------------
- |
作者: |
|
2004/2/13 14:35:14 |
1楼: |
date后没有括号,这不是C,是Delphi,呵呵
----------------------------------------------
-
|
作者: |
|
2004/2/13 15:12:24 |
2楼: |
楼上的: Delphi为了和C/C++兼容,一个没有参数的过程或函数可以带括号.也可以不用括号. 他的错误应该是类型不匹配吧!
----------------------------------------------
-
|
作者: |
|
2004/2/13 15:14:19 |
3楼: |
unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } function a(s: Integer): Integer; function b(i: Integer = 1): integer; function c: Integer; public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.dfm}
function TForm1.a(s: Integer): Integer; begin inc(s); Result := s; end;
function TForm1.b(i: Integer): integer; begin Result := i; end;
procedure TForm1.Button1Click(Sender: TObject); begin Button1.Caption := IntToStr(a(b())); Self.Caption := IntToStr(a(c())); end;
function TForm1.c: Integer; begin Result := 100; end;
end.
----------------------------------------------
-
|
作者: |
|
2004/2/13 16:27:19 |
4楼: |
…… 被禁用帐号,帖子内容自动屏蔽! ……
----------------------------------------------
-
|
作者: |
|
2004/2/13 16:38:45 |
5楼: |
…… 被禁用帐号,帖子内容自动屏蔽! ……
----------------------------------------------
-
|
作者: |
|
2004/2/13 16:57:19 |
6楼: |
使用yearof()好像要在uses中添加DateUtils
----------------------------------------------
=^@^=
|
作者: |
|
2004/2/13 16:58:53 |
7楼: |
. . 次问报 原因最 把报 信息一起发 来 。
----------------------------------------------
=^@^=
|
作者: |
|
2004/2/14 13:45:24 |
8楼: |
…… 被禁用帐号,帖子内容自动屏蔽! ……
----------------------------------------------
-
|
|