Delphi ¹Ø¼ü×ÖÏê½â
absolute
//ËüʹµÃÄãÄܹ»´´½¨Ò»¸öбäÁ¿, ²¢ÇҸñäÁ¿µÄÆðʼµØÖ·ÓëÁíÒ»¸ö±äÁ¿Ïàͬ.
var
Str: string[32];
StrLen: Byte absolute Str;
//Õâ¸öÉùÃ÷Ö¸¶¨Á˱äÁ¿StrLenÆðʼµØÖ·ÓëStrÏàͬ.
//ÓÉÓÚ×Ö·û´®µÄµÚ0¸öλÖñ£´æÁË×Ö·û´®µÄ³¤¶È, ËùÒÔStrLenµÄÖµ¼´×Ö·û´®³¤¶È.
begin
Str := 'abc';
Edit1.Text := IntToStr(StrLen);
end;
abstract
//ËüÔÊÐíÄã´´½¨³éÏóµÄ·½·¨, °üÀ¨ÓгéÏó·½·¨µÄÀà³ÆÎª³éÏóÀà.
//Abstract¹Ø¼ü×Ö±ØÐëÓëVirtual»òDynamic¹Ø¼ü×ÖͬʱʹÓÃ, ÒòΪ³éÏó·½·¨±ØÐë±»¸²¸ÇʽʵÏÖ.
//³éÏóÀ಻ÄÜʵÀý»¯, ³éÏó·½·¨²»Äܰüº¬·½·¨Ìå.
type
TDemo = class
private
protected
procedure X; virtual; abstract;
public
constructor Create;
destructor Destroy; override;
published
end;
and
//Ò»¡¢±íʾÂß¼Óë
if (a>0) and (b>0) then
//¶þ¡¢±íʾλÔËËã
var
a,b,c: Integer;
begin
c := (a and b);
end;
//ʹÓÃAnd±íʾÂ߼ʱ, And×óÓҵıí´ïʽ±ØÐëÓÃСÀ¨ºÅÀ¨Æð, ÒÔ±ÜÃâÒÔÉúÌõ¼þµÄ³åÍ».
//ÀýÈç:
if a>0 and b>0 then
//±àÒëÆ÷¿ÉÄÜ»áÀí½âΪ:
if a>(0 and b)>0 then
//»ò:
if (a>0) and (b>0) then
//µ«ÊÇʵ¼Ê±àÒëʱ, ±àÒëÆ÷»á²úÉúÒ»¸ö³åÍ», ±¨¸æ´íÎó.
//²¢ÇÒµÚÒ»ÖÖ¿ÉÄܰüº¬ÁËa>b>cµÄÐÎʽ, ÕâÔÚDelphiÖв»±»Ö§³Ö.
//ËùÒÔʹÓÃAndÔËËã·ûʱ±ØÐëʹÓÃÀ¨ºÅ, ÒÔÇø·Ö×óÓÒµÄÌõ¼þ.
//±íʾλÔËËãʱҲ±ØÐë¼ÓÉÏÀ¨ºÅ, ½«AndÒÔ¼°×óÓÒ²ÎÊýÀ¨Æð.
array
//ArrayÓÃÓÚ±íʾÊý×é, ÈκεĶÔÏó¶¼Äܱ»ÉùÃ÷³ÉÊý×é.Êý×é·ÖΪ¾²Ì¬ºÍ¶¯Ì¬µÄ£²ÖÖ.
//¾²Ì¬Êý×é
var
Arr1: array [1..10] of Integer;
//¶¯Ì¬Êý×é, ÓÉÓÚÉùÃ÷ʱ²»ÖªÆäÔªËØ¸öÊý, ËùÒÔ±ØÐëÔÚºóÆÚÓÃSetLength·½·¨ÉèÖÃÊý×éµÄ´óС
var
Arr2: array of Integer;
//Êý×é×÷Ϊ²ÎÊýʱ, ²»ÄÜ´«ÈëÊý×éµÄ´óС, Ö»ÄÜ´«ÈëÊý×éÃû, È»ºóÓÃLength·½·¨»ñÈ¡Êý×éµÄÔªËØ¸öÊý
function X(A: array of Integer): Integer;
var
i: Integer;
begin
Result := 0;
for i := 0 to Length(A)-1 do
Result := Result + A[i];
end;
as
//AsÓÃÓÚ½«Ò»¸ö¶ÔÏóת»»ÎªÁíÒ»¸ö¶ÔÏó
procedure BtnClick(Sender:TObject);
begin
(Sender as TButton).Caption := 'Clicked';
end;
//¶ÔÓÚ¶ÔÏóÌî³ä½Ó¿ÚµÄת»», ±ØÐëÓÃAs½øÐÐ
(HTTPRIO as IExp).GetConnection;
//As²»ÄÜÓÃÓÚÊý¾ÝÀàÐ͵Äת»», ÏÂÃæµÄ´úÂë
Ïà¹ØÎĵµ£º
´ËÎÄÊʺÏDelphiÐÂÊÖÔĶÁ£¬ÌرðÊÇÁ¬½ÓÊý¾Ý¿â·½Ã滹һ¶®°ë¶®ÉõÖÁ¸ù±¾²»¶®µÄÐÂÊÖ£»
--------------------------µ«×ÜÌåÏÔµÃÓеãÂÒ-------------------------
±¾ÎÄÕÂÒÔDelphi 7ºÍSQL Server 2000ΪÀý£¬¿Ø¼þÃû¾ùΪϵͳĬÈÏ£¬ÈçUnit1,DataModule1,Edit1,ADOCommand1,ADODataS ......
Ãû³Æ ÀàÐÍ ËµÃ÷
abort º¯Êý ÒýÆð·ÅÆúµÄÒâÍâ´¦Àí
abs º¯Êý ¾ø¶ÔÖµº¯Êý
addexitproc º¯Êý ½«Ò»¹ý³ÌÌí¼Óµ½ÔËÐÐʱ¿âµÄ½áÊø¹ý³Ì±íÖÐ
addr º¯Êý ·µ»ØÖ¸¶¨¶ÔÏóµÄµØÖ·
adjustlinebreaks º¯Êý ½«¸ø¶¨×Ö·û´®µÄÐзָô·ûµ÷ÕûΪcr/lfÐòÁÐ
align Êô ......
¡ó[DELPHI]²úÉúÊó±êÍ϶¯Ð§¹û
ͨ¹ýMouseMoveʼþ¡¢DragOverʼþ¡¢EndDragʼþʵÏÖ£¬ÀýÈçÔÚPANELÉϵÄLABEL£º
var xpanel,ypanel,xlabel,ylabel:integer;
PANELµÄMouseMoveʼþ£ºxpanel:=x;ypanel:=y;
PANELµÄDragOverʼþ£ºxpanel:=x;ypanel:=y;
LABELµÄMouseMoveʼþ£ºxlabel:=x;ylabel:=y;
LABELµÄEndDragʼþ£ºlabel ......
Delphi ActiveX FormµÄʹÓÃʵÀý
By knityster
1. ActiveX¿Ø¼þ¼ò½é
ActiveX¿Ø¼þÒ²¾ÍÊÇÒ»°ãËù˵µÄOCX¿Ø¼þ£¬ËüÊÇActiveX¼¼ÊõµÄÒ»²¿·Ö¡£
ActiveX¿Ø¼þ¿ÉÒÔ±»¼¯³Éµ½ºÜ¶àÖ§³ÖActiveXµÄÓ¦Óõ±ÖÐÈ¥£¬»òÕßÖ±½ÓÓÃÀ´À©Õ¹Ó¦ÓõŦÄÜ£¬ÕâЩ֧³ÖActiveXµÄÓ¦ÓðüÀ¨C++ Builder¡¢Delphi¡¢Visual dBASE¡¢ Visual Basic¡¢Visual C++¡ ......
ÖÆ×÷Ô²½Ç¾ØÐεĴ°Ì壺
01.procedure TPortForm.FormCreate(Sender: Tobject);
02.var hr :thandle;
03.begin
04.hr:=createroundrectrgn(0,0,width,height,20,20);
05.setwindowrgn(handle,hr,true);
06.end;
Èç¹û²»Òª´°ÌåÍâ¿ò£¬ÔòʹÓãº
01.procedure TPortForm.FormCreate(Sender: Tobject);
02.var hr :thandl ......