Delphi Êý×éºÍ½á¹¹Ìå
¼¼Êõ½»Á÷,DH½²½â. ¼ÇµÃºÜÔç֮ǰÎÒ¾Í˵¹ý,Êý×éºÍ½á¹¹ÌåÔÚÄÚ´æÖÐÆäʵһÑùµÄ,ËûÃǶ¼ÊÇÁ¬Ðø·Ö²¼µÄ.
ÀýÈç: TMyStruct = record
A,B,C:Integer;
end;
T3IntArray = array[0..2]of Integer;
ÕâÁ½¸ö¶¼Õ¼12×Ö½Ú,¶øÇÒTMyStruct.A¾ÍÊÇT3IntArray[0].
¶øÎÒÃÇÖªµÀÔÚ·ÃÎÊÊý×éÖÐij¸öÔªËصÄʱºò,Ö»ÊÇÔÚµÚÒ»¸öÔªËصĵØÖ· + ÐòºÅ * ÔªËØ´óС.
ÄÇô·ÃÎʽṹÌåÓ¦¸ÃÒ²ÊÇÕâÑùµÄ,Ö»ÊǽṹÌåÖÐÿ¸öÔªËصĴóС²»Ò»¶¨¶¼ÊÇÒ»ÑùµÄ,¶øÊý×éÖÐÿ¸öÔªËض¼ÊÇÒ»ÑùµÄ.
ºÃµÄÎÒÃÇÀ´¿´¶Î´úÂë:
type
TMyStruct = record
A,B,C:Integer;
end;
T3IntArray = array[0..2]of Integer;
PMyStruct = ^TMyStruct;
procedure TForm2.Button2Click(Sender: TObject);
var
aArray:array[0..99] of Byte;
P:PMyStruct;
I: Integer;
begin
P:=PMyStruct(@aArray[0]);
for I := 0 to 5 - 1 do
begin
P^.A:=55;
P^.B:=66;
P^.C:=77;
Inc(P);
end;
end;
ÆäʵÕâ¸öPÎÒÃÇÏ൱ÓÚ¶¨ÒåÒ»¸öTMyStructµÄÊý×é,ÓÐ5¸öÔªËØ,µ«ÊÇÎÒÃǶ¨ÒåµÄÊÇÒ»¸öÖ¸Õë,¶øÇÒûÓзÖÅä¿Õ¼ä,ÎÒÊÇÔÚaArrayµÄ¿Õ¼äÉÏÃæʹÓÃ.
Ò²¾ÍÊǹý³Ì½áÊøµÄʱºò,aArray¿Õ¼ä±»ÊÕ»Ø,ÄÇôPÒ²¾ÍÏûʧÁË.¿´¿´·´»ã±à´úÂë:
utMain.pas.143: P:=PMyStruct(@aArray[0]);
004B6ACB 8BC4 mov eax,esp
utMain.pas.144: for I := 0 to 5 - 1 do
004B6ACD BA05000000 mov edx,$00000005 //Ñ»·±äÁ¿
utMain.pas.146: P^.A:=55;
004B6AD2 C70037000000 mov [eax],$00000037 //¶ÔA¸³Öµ55
utMain.pas.147: P^.B:=66;
004B6AD8 C7400442000000 mov [eax+$04],$00000042 //¶ÔB¸³Öµ66
utMain.pas.148: P^.C:=77;
004B6ADF C740084D000000 mov [eax+$08],$0000004d //¶ÔC¸³Öµ
utMain.pas.149: Inc(P);
004B6AE6 83C00C add eax,$0c //Òƶ¯Ö¸Õë,Ò»¸öTMyStructµÄ´óСÊÇ3*4=12=$0c
utMain.pas.144: for I := 0 to 5 - 1 do
004B6AE9 4A dec edx
004B6AEA 75E6 jnz $004b6ad2
ºÜÇå³þµÄ¿´µ½ÁË,·ÃÎʺÍÐ޸ĽṹÌåÖÐij¸öÔªËصÄÖµ,Ò²ÊÇÔڽṹÌåÖ¸ÕëÉÏÃæ½øÐÐÆ«ÒÆ.
ºÃµÄ,ÏÂÒ»´Î¿´¿´Ã¶¾Ù.
·Å¼ÙÁË.ÔÚ¼ÒÃ×ÓÐÍøÁË.ºÃºÃѧϰһÏÂ.
Ïà¹ØÎĵµ£º
¼¼Êõ½»Á÷,DH½²½â. ֮ǰÕÕ×ÅÌìÊéÒ¹¶Á,ÓÃDelphiÀ´ÅªÁËÏÂÑ»·Ìå,ÏÖÔÚ¾ÍÀ´ÅªÒ»ÏÂÌõ¼þÅжϰÉ.
Ê×Ïȿ϶¨ÊÇÎÒÃǾ³£¿´¼ûµÄIFÓï¾ä¿©. Var
I: Integer;
Begin
I:= 99;
If (I> 0)And (I< 0) Then
Writeln('I>0')
Else
If (I> 10)And (I< 100) Then
Writeln('I>10 and I100');
End.
·´»ã±à³öÀ´»áÊÇ ......
tableDB.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+ ExtractFilePath(dir) +';Extended Properties=dBase 5.0;Persist Security Info=False;';
tableDB.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+ExtractFilePath(dir)+';Extended Pro ......
ÔÚ±àÖÆÁËÒ»¸öÓ¦ÓóÌÐòºóµÄά»¤½×¶Î£¬ÎÒÃÇ»áÃæÁÙ¸øÓ¦ÓóÌÐòÉý¼¶µÄ¹¤×÷.ÎÞÒÉ£¬ÊÖ¹¤Éý¼¶µÄ¹¤×÷ÊÇÊ®·Ö·±ËöµÄ£¬Äã¿ÉÄÜ»áÐèÒªµ½Óû§µÄ»úÆ÷ÉÏÈ¥¸üÐÂÎļþ.¿ÉÊÇ£¬Èç¹ûÄܱàÒ»¸ö×Ô¶¯Éý¼¶³ÌÐò£¬·ÅÔÚÍøÂçÉÏ£¬ÈÃÓû§ÏÂÔØ£¬Ö»ÐèÖ´ÐÐһϾÍÍê³ÉÉý¼¶¹¤×÷£¬²»ÊǺܷ½±ãÂð£¿Æäʵ£¬ÓÃDelphi¿ÉÒԺܷ½±ãµØ±àÖƳöÕâÑùÒ»¸öµÄ³ÌÐò.
ÒÔÏÂÊÇÎÒÃǵÄÀý×Ó£ ......
ÀýÈçÒÔÏ´úÂ룺
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs;
type
TForm1 = class(TForm)
procedure one();
function two(x,y:integer):integer;
private
......
DelphiÖ®Tchart¿Ø¼þʹÓÃÐĵÃ
×î½üÔÚѧϰdelphi£¬×öÒ»¸öÈí¼þÁ·ÊÖ£¬Óõ½Tchart¿Ø¼þ£¬ÓÐЩ´ÖÂÔµÄʹÓÃÐĵ㬹©delphi³õѧÕ߲ο¼¡£
TChartÊÇdelphiÀïÃæÒ»¸ö±ê×¼µÄͼÐÎÏÔʾ¿Ø¼þ¡£Ëü¿ÉÒÔ¾²Ì¬Éè¼Æ£¨at design time£©Ò²¿ÉÒÔ¶¯Ì¬Éú³É¡£¿ÉÏÂÔØSteema TeeChart 7£¬Ã»ÓÐÔ´´úÂ룬ÄÜÓþͺã¡
&nb ......