1类方法(method)的声明和使用type
 2类方法(method)的声明和使用  TMan = class(TObject)
 3类方法(method)的声明和使用  public
 4类方法(method)的声明和使用    procedure sleep(TheHour: Integer);
 5类方法(method)的声明和使用    // Public declarations
 6类方法(method)的声明和使用  end;
 7类方法(method)的声明和使用type
 8类方法(method)的声明和使用  TForm1 = class(TForm)
 9类方法(method)的声明和使用    Button1: TButton;
10类方法(method)的声明和使用    procedure Button1Click(Sender: TObject);
11类方法(method)的声明和使用  private
12类方法(method)的声明和使用    { Private declarations }
13类方法(method)的声明和使用  public
14类方法(method)的声明和使用    { Public declarations }
15类方法(method)的声明和使用  end;
16类方法(method)的声明和使用
17类方法(method)的声明和使用implementation
18类方法(method)的声明和使用
19类方法(method)的声明和使用
20类方法(method)的声明和使用{ type
21类方法(method)的声明和使用  TMan = class(TObject)
22类方法(method)的声明和使用  public
23类方法(method)的声明和使用    procedure sleep(TheHour: Integer);
24类方法(method)的声明和使用    // Public declarations
25类方法(method)的声明和使用  end;
26类方法(method)的声明和使用PROCEDURE TMan.sleep(TheHour: Integer); //在 implementation里也可以声明类 TMan }
27类方法(method)的声明和使用PROCEDURE TMan.sleep(TheHour: Integer); // 在 interface里声明类 TMan
28类方法(method)的声明和使用BEGIN
29类方法(method)的声明和使用   CASE TheHour OF    //
30类方法(method)的声明和使用     0..5: ShowMessage('不睡觉干嘛?') ;
31类方法(method)的声明和使用     6..8: ShowMessage('还是想睡!') ;
32类方法(method)的声明和使用     9..12: ShowMessage('无奈一天已过了一半' + #13 + '起来好了!') ;
33类方法(method)的声明和使用     13..20: ShowMessage('呒,你是小@#') ;
34类方法(method)的声明和使用     21..24: ShowMessage('你和树袋熊是同宗的哦??') ;
35类方法(method)的声明和使用   else
36类方法(method)的声明和使用      ShowMessage('一天只有24小时吧??');
37类方法(method)的声明和使用   END;    // case
38类方法(method)的声明和使用END;
39类方法(method)的声明和使用procedure TForm1.Button1Click(Sender: TObject);
40类方法(method)的声明和使用VAR
41类方法(method)的声明和使用  Stime: TMan;
42类方法(method)的声明和使用  i: Integer;
43类方法(method)的声明和使用begin
44类方法(method)的声明和使用  i := StrToInt( InputBox('一天睡事知多少<>','输入每天睡眠时数','8'));
45类方法(method)的声明和使用  Stime := TMan.Create;
46类方法(method)的声明和使用  Stime.sleep(i);
47类方法(method)的声明和使用  Stime.Free;
48类方法(method)的声明和使用end;
49类方法(method)的声明和使用
50类方法(method)的声明和使用

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
  • 2021-12-26
  • 2021-12-17
  • 2021-10-11
猜你喜欢
  • 2021-05-24
  • 2022-01-04
  • 2022-02-25
  • 2022-01-18
  • 2021-06-21
  • 2021-07-30
相关资源
相似解决方案