語言字元集

Object Pascal 使用ASCII 字元集,包括A-Z、a-z、0-9、以及其它標準字元,字母是大小寫無關.單字元特殊符號:# $ & ' ( ) * + , - . / : ; @ [ ] ^ { }組合字元特殊符號:(* *) (. .) .. // := = 其中:‘[]’相當於‘(..)’; ‘(**)’相當於‘{}’! " % ? \ _ | ~ 不是特殊符號.標誌符用來給常量、變數、欄位、類型、屬性、

not 與整數

//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:

@ 與 ^ 運算子

//例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;

將漢字翻譯成拼音縮寫的函數

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,

常用的表格效果

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;

Pascal 語言中的關鍵字及保留字

absolute//指令(變數)abstract//指令(方法)and//運算子(布爾)array//類型as//運算子(RTTI)asm//語句assembler//向後相容(彙編)at//語句(異常處理)automated//訪問類別符(類)begin//塊標記case//語句cdecl//函數調用協定class//類型const//聲明或指令(參數)constructor//特殊方法contains//運算子(集合)default//指令(屬性)destructor//特殊方法dispid

註冊系統級熱鍵

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

PDF 中的對象

對象功能ADBCAcrobat Database Connectivity(ADBC)是一個跨平台的外掛程式。可以在Adobe PDF中以Acrobat JavaScript串連同時以SQL文法控管資料庫。雖然ADBC可以對資料庫進行存取的動作,但是ADBC必須透過系統的ODBC、JDBC的協助才能連結資料庫。所以,ADBC僅適合對單機的資料庫進行存取,而網路資料庫則由FDF與後端程式提供服務。AnnotAnnot對象以Acrobat

System 提供的編譯期函數

Dec//將常式中的參數值遞減1或一個特定的值,其中特定值可在第二個選擇性參數中定義Inc//將常式中的參數值增加1或一個特定的值Odd//如果參數為奇數返回真Pred//根據參數在其資料類型定義中的序列,返回參數值的前驅值Succ//返回參數值的後繼值Ord//返回參數值在其資料類型值集合中的序號Chr//取得 AscII 碼對應的字元Low//返回參數對應的有序資料類型的最小取值High//返回參數對應的有序資料類型的最大取值SizeOf//取得類型或對象所佔的記憶體位元組數

is 與 as 運算子舉例

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);

常用時間函數列表

函數功能Now返回當前日期及時間Date返回當前日期Time返回目前時間DateTimeToStr按預設格式將日期和時間值轉換為字串;特定格式轉換可用

程式流程的輔助控制

Abort//激發異常退出,如果在 try 塊中,except 和 finally 的程式會執行Exit//正常退出,如果在 try 塊中,except 和 finally 的程式會執行Halt//非正常結束程式,可有 Integer 參數給作業系統,windows 程式一般使用:Application.TerminateRunError//產生一個執行階段錯誤,並退出程式。參數是 Byte 型,預設0Continue//結束當前迴圈進入下一迴圈Break//結束迴圈Sleep//暫停多少毫秒

Edit 的使用

//讓 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])

Delphi 資料類型列表

分類範圍位元組備忘簡單類型序數整數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 ..

Memo 的當前行、當前列與當前字元

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 :=

Delphi 編譯錯誤資訊表

; 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

To Do 注釋的運用

每次開發前應該有個計劃,先做什麼、後做什麼;最後檢查完成情況。To Do 注釋可以很好地達到以上要求。先建立程式架構,用 Ctrl+Shift+T 添加 To Do 注釋;同時表明標題資訊、序號、所屬人和分類等等,也可以省略。用 Alt+V+I 可以開啟 To Do 列表;通過列表可以方便到達某個位置;可以標記哪些已完成;可以通過各種方式過濾或排序查看;可以只顯示未完成的項目;可以刪除已完成的項目(同時刪除注釋)。

類方法調用

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

覆蓋虛方法

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

調用外部 DLL 中的函數(2. 晚綁定)

unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type //晚綁定,也就是動態調用外部函數主要用以下三個命令: //LoadLibrary:擷取 DLL //GetProcAddress:擷取函數 //FreeLibrary:釋放 //定義一個過程類型,參數要和需要的函數一致 TMB =

總頁數: 61357 1 .... 4804 4805 4806 4807 4808 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.