Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ :

Delphi Éè¼ÆÄ£Ê½£º¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Delphi7´úÂë

1. ÃüÁîµÄ½ÓÊÕÕß
{¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Ö®ÃüÁîģʽ }
{ ±¾µ¥ÔªÖеÄÀàΪÃüÁîµÄ½ÓÊÕÕß }
{ ±àÒ빤¾ß £ºDelphi7.0 }
{ ÁªÏµ·½Ê½ £ºxshlife@163.com }

unit uReceiveObject;

interface

type
TLight = class(TObject)
private
FLocation: String;
public
constructor Create(aLocation: String);
procedure Open;
procedure Off;
end;

TCeilingFan = class(TObject)
private
FLevel : Integer;
FLocation: String;
function GetSpeed: Integer;
public
constructor Create(aLocation: String);
procedure High;
procedure Medium;
procedure Low;
procedure Off;
property Speed: Integer read GetSpeed;
end;

TGarageDoor = class(TObject)
private
FLocation: String;
public
constructor Create(aLocation: String);
procedure Up;
procedure Down;
procedure Stop;
procedure LightOn;
procedure LightOff;
end;

TStereo = class(TObject) ......

Delphi Éè¼ÆÄ£Ê½£º¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Delphi7´úÂë

ÃüÁîģʽ¿ÉÒÔºÜÇáËɵÄʵÏÖ³·Ïú£¨Undo£©¹¦ÄÜ¡£
1. ÃüÁîµÄ½ÓÊÜÕß
unit uReceiveObject;

interface

type
TLight = class(TObject)
public
procedure Open;
procedure Off;
end;

implementation

{ TLight }

procedure TLight.Off;
begin
Writeln('Light is off.');
end;

procedure TLight.Open;
begin
Writeln('Light is on.');
end;

end.


2.ÃüÁî¶ÔÏó
unit uReceiveObject;

interface

type
TLight = class(TObject)
public
procedure Open;
procedure Off;
end;

implementation

{ TLight }

procedure TLight.Off;
begin
Writeln('Light is off.');
end;

procedure TLight.Open;
begin
Writeln('Light is on.');
end;

end.


 
3.ÃüÁîµÄÇëÇóÕß
unit uSimpleRemoteWithUndo;

interface

uses
uCommandObject;

type
TSimpleRemoteWithUndo = class(TObject)
private
FOnCommand : TCommand;
FOffCommand : TCommand;
FUndoCommand: TCommand;
......

Delphi Éè¼ÆÄ£Ê½£º¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Delphi7´úÂë

1. ÃüÁîµÄ½ÓÊÜÕß
unit uReceiveObject;
interface
type
TLight = class(TObject)
public
procedure Open;
procedure Off;
end;
TGarageDoor = class(TObject)
public
procedure Up;
procedure Down;
procedure Stop;
procedure LightOn;
procedure LightOff;
end;
implementation
{ TLight }
procedure TLight.Off;
begin
Writeln('');
end;
procedure TLight.Open;
begin
Writeln('Light is On.');
end;
{ TGarageDoor }
procedure TGarageDoor.Down;
begin
Writeln('');
end;
procedure TGarageDoor.LightOff;
begin
Writeln('');
end;
procedure TGarageDoor.LightOn;
begin
Writeln('');
end;
procedure TGarageDoor.Stop;
begin
Writeln('');
end;
procedure TGarageDoor.Up;
begin
Writeln('GarageDoor is Open.');
end;
end.

2.ÃüÁî¶ÔÏó
unit uCommandObject;
interface
uses
uReceiveObject;
type
TCommand = class(TObject)
public
procedure Execute; virtual; abstract;
end;
TLightOnCommand = class(TCommand)
private ......

Delphi Éè¼ÆÄ£Ê½£º¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Delphi7´úÂë

ûÓÐÓ¦ÓÃ״̬ģʽµÄ´úÂë
1. ¹¤³ÌÎļþ
program Project1;
{$APPTYPE CONSOLE}
uses
uGumballMachine in 'uGumballMachine.pas';
var
aGumballMachine: TGumballMachine;
begin
aGumballMachine := TGumballMachine.Create(5);
aGumballMachine.InsertQuarter;
aGumballMachine.TurnCrank;
Writeln;
aGumballMachine.InsertQuarter;
aGumballMachine.EjectQuarter;
aGumballMachine.TurnCrank;
Writeln;
aGumballMachine.InsertQuarter;
aGumballMachine.TurnCrank;
aGumballMachine.InsertQuarter;
aGumballMachine.TurnCrank;
aGumballMachine.EjectQuarter;
Writeln;
aGumballMachine.InsertQuarter;
aGumballMachine.InsertQuarter;
aGumballMachine.TurnCrank;
aGumballMachine.InsertQuarter;
aGumballMachine.TurnCrank;
aGumballMachine.InsertQuarter;
aGumballMachine.TurnCrank;
aGumballMachine.Free;
Readln;
end.
2.µ¥ÔªÎļþ
unit uGumballMachine;
interface
type
TGumballMachine = class(TObject)
private
FState: Integer;
FCount: Integer;
pub ......

javascript ֪ʶÕûÀí

 javascript ֪ʶÕûÀí
1¡¢screen ÆÁÄ»¶ÔÏó
      screen ÆÁÄ»¶ÔÏó ·´Ó³Á˵±Ç°Óû§µÄÆÁÄ»ÉèÖá£
      width ·µ»ØÆÁÄ»µÄ¿í¶È£¨ÏñËØÊý£©¡£
      height ·µ»ØÆÁÄ»µÄ¸ß¶È¡£
      availWidth ·µ»ØÆÁÄ»µÄ¿ÉÓÿí¶È£¨³ýÈ¥ÁËһЩ²»×Ô¶¯Òþ²ØµÄÀàËÆÈÎÎñÀ¸µÄ¶«Î÷ËùÕ¼ÓõĿí¶È£©¡£
      availHeight ·µ»ØÆÁÄ»µÄ¿ÉÓø߶ȡ£
      colorDepth ·µ»Øµ±Ç°ÑÕÉ«ÉèÖÃËùÓõÄλÊý - 1£ººÚ°×£»8£º256É«£»16£ºÔöǿɫ£»24/32£ºÕæ²ÊÉ« ......

JavaScriptÖеÄÈýÖÖµ¯³ö¿ò

JavaScriptÖеÄÈýÖÖµ¯³ö¿ò:¾¯¸æ(alert)¡¢È·ÈÏ(confirm)ÒÔ¼°ÌáÎÊ(prompt)
<script type="text/JavaScript">
 function testAlert(){
 alert("ÎÒ¾ÍÊÇ´«ËµÖеÄalert!!!");
 }
function testConfirm(){
     var r=confirm("ÄãÊDzËÄñÂð£¿");
  if(r==true){
    alert("±Ë´Ë±Ë´Ë");
  }
  else{
    alert("ÎÒÊÇÀÏÄñ");
  }
   }
function testPrompt(){
     var score;
  var degree;
  score=prompt("ÄãµÄ·ÖÊýÊÇ");
  if(score>100){
    degree="Ë£ÎÒ£¬100¾ÍÂú·ÖÀ²£¡";
  }else if(score<0){
    degree="Ë£ÎÒ£¬×îÉÙÒ²µÃ¸ø¸öÁãµ°°¡";
  }
  else{
 
   switch(parseInt(score/10)){
    case 0:
    case 1:
    case 2:
    case 3:
    case 4:
    case 5: degree="ûÓм°¸ñ"; break;
    case 6: degree="¸ ......
×ܼǼÊý:40319; ×ÜÒ³Êý:6720; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [5539] [5540] [5541] [5542] 5543 [5544] [5545] [5546] [5547] [5548]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ