Time of Update: 2018-12-07
Object Pascal 使用ASCII 字元集,包括A-Z、a-z、0-9、以及其它標準字元,字母是大小寫無關.單字元特殊符號:# $ & ' ( ) * + , - . / : ; @ [ ] ^ { }組合字元特殊符號:(* *) (. .) .. // := = 其中:‘[]’相當於‘(..)’; ‘(**)’相當於‘{}’! " % ? \ _ | ~ 不是特殊符號.標誌符用來給常量、變數、欄位、類型、屬性、
Time of Update: 2018-12-07
//Byteprocedure TForm1.Button1Click(Sender: TObject);var x,y: Byte;begin x := MAXBYTE; //MAXBYTE是常數255 y := not x; //y 的值是 0 x := 5; y := not x; //y 的值是 250 ShowMessage(IntToStr(y));end;//Wordprocedure TForm1.Button1Click(Sender:
Time of Update: 2018-12-07
//例1:procedure TForm1.Button1Click(Sender: TObject);var str: string; p: Pointer;begin p := @str; //變數 str 的地址 p := @Form1; //變數 Form1 的地址 p := @TForm1.Button1Click; //過程 TForm1.Button1Click 的地址 p := Addr(str); //同 p := @str;
Time of Update: 2018-12-07
function GetPyChar(const HZ: AnsiString): string;const HZCode: array[0..25, 0..1] of Integer = ((1601, 1636), (1637, 1832), (1833, 2077), (2078, 2273), (2274, 2301), (2302, 2432), (2433, 2593), (2594, 2786), (9999, 0000), (2787, 3105), (3106,
Time of Update: 2018-12-07
123456//代碼如下:123456//也可以用樣式表控制:#table1{ background-color:#000000;//表格整體背景黑色,也就是縫隙間的顏色 width:500px; padding:0px; border-spacing:1px;//表格縫隙1個px}#table1 td{ background-color:#FFFFFF;} #table2{ border:1px solid #000000;//為表格外面畫線 width:500px;
Time of Update: 2018-12-07
absolute//指令(變數)abstract//指令(方法)and//運算子(布爾)array//類型as//運算子(RTTI)asm//語句assembler//向後相容(彙編)at//語句(異常處理)automated//訪問類別符(類)begin//塊標記case//語句cdecl//函數調用協定class//類型const//聲明或指令(參數)constructor//特殊方法contains//運算子(集合)default//指令(屬性)destructor//特殊方法dispid
Time of Update: 2018-12-07
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); private procedure
Time of Update: 2018-12-07
對象功能ADBCAcrobat Database Connectivity(ADBC)是一個跨平台的外掛程式。可以在Adobe PDF中以Acrobat JavaScript串連同時以SQL文法控管資料庫。雖然ADBC可以對資料庫進行存取的動作,但是ADBC必須透過系統的ODBC、JDBC的協助才能連結資料庫。所以,ADBC僅適合對單機的資料庫進行存取,而網路資料庫則由FDF與後端程式提供服務。AnnotAnnot對象以Acrobat
Time of Update: 2018-12-07
Dec//將常式中的參數值遞減1或一個特定的值,其中特定值可在第二個選擇性參數中定義Inc//將常式中的參數值增加1或一個特定的值Odd//如果參數為奇數返回真Pred//根據參數在其資料類型定義中的序列,返回參數值的前驅值Succ//返回參數值的後繼值Ord//返回參數值在其資料類型值集合中的序號Chr//取得 AscII 碼對應的字元Low//返回參數對應的有序資料類型的最小取值High//返回參數對應的有序資料類型的最大取值SizeOf//取得類型或對象所佔的記憶體位元組數
Time of Update: 2018-12-07
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ActnList, StdCtrls, ExtCtrls;type TForm1 = class(TForm) Button1: TButton; Edit1: TEdit; procedure FormCreate(Sender: TObject);
Time of Update: 2018-12-07
函數功能Now返回當前日期及時間Date返回當前日期Time返回目前時間DateTimeToStr按預設格式將日期和時間值轉換為字串;特定格式轉換可用
Time of Update: 2018-12-07
Abort//激發異常退出,如果在 try 塊中,except 和 finally 的程式會執行Exit//正常退出,如果在 try 塊中,except 和 finally 的程式會執行Halt//非正常結束程式,可有 Integer 參數給作業系統,windows 程式一般使用:Application.TerminateRunError//產生一個執行階段錯誤,並退出程式。參數是 Byte 型,預設0Continue//結束當前迴圈進入下一迴圈Break//結束迴圈Sleep//暫停多少毫秒
Time of Update: 2018-12-07
//讓 Edit 只接受數字//方法1:procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin if not (Key in ['0'..'9']) then Key := Chr(0);end;//方法2:procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin if not (Byte(Key) in [48..57])
Time of Update: 2018-12-07
分類範圍位元組備忘簡單類型序數整數Integer-2147483648 .. 21474836474有符號32位Cardinal0 .. 42949672954無符號32位Shortint-128 .. 1271有符號8位Smallint-32768 .. 327672有符號16位Longint-2147483648 .. 21474836474有符號32位Int64-263 .. 2638有符號64位Byte0 .. 2551無符號8位Word0 ..
Time of Update: 2018-12-07
procedure TForm1.Memo1Click(Sender: TObject);begin Text := Format('當前列:%d, 當前行:%d', [Memo1.CaretPos.X, Memo1.CaretPos.Y]);end;//用 API 實現procedure TForm1.Memo1Click(Sender: TObject);var LineY,LineX: Integer;begin LineY :=
Time of Update: 2018-12-07
; not allowed before ELSEElSE前不允許有“;”<clause> clause not allowed in OLE automation section在OLE自動區段不允許“<clause>”子句<name> is not a type identifier<name>不是類型標識符<name> not previously declared as a
Time of Update: 2018-12-07
每次開發前應該有個計劃,先做什麼、後做什麼;最後檢查完成情況。To Do 注釋可以很好地達到以上要求。先建立程式架構,用 Ctrl+Shift+T 添加 To Do 注釋;同時表明標題資訊、序號、所屬人和分類等等,也可以省略。用 Alt+V+I 可以開啟 To Do 列表;通過列表可以方便到達某個位置;可以標記哪些已完成;可以通過各種方式過濾或排序查看;可以只顯示未完成的項目;可以刪除已完成的項目(同時刪除注釋)。
Time of Update: 2018-12-07
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations
Time of Update: 2018-12-07
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations
Time of Update: 2018-12-07
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type //晚綁定,也就是動態調用外部函數主要用以下三個命令: //LoadLibrary:擷取 DLL //GetProcAddress:擷取函數 //FreeLibrary:釋放 //定義一個過程類型,參數要和需要的函數一致 TMB =