九九热最新网址,777奇米四色米奇影院在线播放,国产精品18久久久久久久久久,中文有码视频,亚洲一区在线免费观看,国产91精品在线,婷婷丁香六月天

歡迎來到裝配圖網(wǎng)! | 幫助中心 裝配圖網(wǎng)zhuangpeitu.com!
裝配圖網(wǎng)
ImageVerifierCode 換一換
首頁 裝配圖網(wǎng) > 資源分類 > DOC文檔下載  

Delphi參考手冊(cè)0.doc

  • 資源ID:13550836       資源大?。?span id="24d9guoke414" class="font-tahoma">7.15MB        全文頁數(shù):1101頁
  • 資源格式: DOC        下載積分:8積分
快捷下載 游客一鍵下載
會(huì)員登錄下載
微信登錄下載
三方登錄下載: 微信開放平臺(tái)登錄 支付寶登錄   QQ登錄   微博登錄  
二維碼
微信掃一掃登錄
下載資源需要8積分
郵箱/手機(jī):
溫馨提示:
用戶名和密碼都是您填寫的郵箱或者手機(jī)號(hào),方便查詢和重復(fù)下載(系統(tǒng)自動(dòng)生成)
支付方式: 支付寶    微信支付   
驗(yàn)證碼:   換一換

 
賬號(hào):
密碼:
驗(yàn)證碼:   換一換
  忘記密碼?
    
友情提示
2、PDF文件下載后,可能會(huì)被瀏覽器默認(rèn)打開,此種情況可以點(diǎn)擊瀏覽器菜單,保存網(wǎng)頁到桌面,就可以正常下載了。
3、本站不支持迅雷下載,請(qǐng)使用電腦自帶的IE瀏覽器,或者360瀏覽器、谷歌瀏覽器下載即可。
4、本站資源下載后的文檔和圖紙-無水印,預(yù)覽文檔經(jīng)過壓縮,下載后原文更清晰。
5、試題試卷類文檔,如果標(biāo)題沒有明確說明有答案則都視為沒有答案,請(qǐng)知曉。

Delphi參考手冊(cè)0.doc

Delphi參考手冊(cè)(4.0)第一部分 關(guān)于Delphi 4.0第一章 Delphi 4 新 特 性Delphi 4 真“ 酷” ! - 倍 受 矚 目 的Delphi 4 已 正 式 在 中 國 上 市, 這 是Borland 更 名 為Inprise 后 推 出 的 一 個(gè) 具 有 戰(zhàn) 略 意 義 的 產(chǎn) 品。 與 老 版 本 相 比,Delphi 4 具 有 哪 些 值 得 稱 道 的 新 功 能 ? 讀 了 這 篇 文 章, 你 或 許 會(huì) 對(duì) 它 有 所 了 解。 Advanced Debugging- Delph 4 增 加 了“ 模 塊 窗 口”。 模 塊 窗 口 能 夠 顯 示 當(dāng) 前 所 有 映 射 到 應(yīng) 用 程 序 地 址 空 間 的 模 塊, 包 括 應(yīng) 用 程 序 自 身、 應(yīng) 用 程 序 顯 式 或 隱 式 調(diào) 用 的DLL 以 及 操 作 系 統(tǒng) 調(diào) 用 的DLL, 模 塊 窗 口 可 幫 助 您 優(yōu) 化 程 序 結(jié) 構(gòu)。 此 外,Delphi 4 還 能 自 動(dòng) 記 錄 在 調(diào) 試 過 程 遇 到 的 事 件, 如 斷 點(diǎn)、Windows 的 消 息 以 及 其 他 調(diào) 試 信 息。Delphi 4 能 夠 監(jiān) 視 指 針 錯(cuò) 誤, 如 果 某 個(gè) 指 針 試 圖 非 法 訪 問 內(nèi) 存 的 某 個(gè) 地 址, 程 序 就 會(huì) 暫 時(shí) 中 斷 運(yùn) 行, 由 調(diào) 試 器 接 管 控 制 權(quán), 就 好 像 遇 到 斷 點(diǎn) 一 樣。 CodeInsight- CodeInsight 是 一 組 代 碼 自 動(dòng) 化 功 能 的 總 稱, 它 能 夠 幫 助 您 快 速 生 成 代 碼, 從 而 減 少 語 法 錯(cuò) 誤 并 提 高 編 程 效 率。Delphi 3 已 經(jīng) 有 了CodeInsight 功 能, 但Delphi 4 又 作 了 很 多 改 進(jìn)。 - 一 是“ 類 自 動(dòng) 完 成”。 由 于Delphi 4 是 一 個(gè) 完 全 面 向 對(duì) 象 的 編 程 工 具, 編 程 過 程 中 經(jīng) 常 要 聲 明 和 實(shí) 現(xiàn) 類(Class), 而 類 不 同 于 一 般 的 數(shù) 據(jù) 類 型, 它 具 有 特 殊 的 語 法, 很 多 初 學(xué) 者 往 往 對(duì) 類 的 使 用 缺 少 經(jīng) 驗(yàn), 即 使 是Delphi 的 高 手, 也 會(huì) 對(duì) 過 分 嚴(yán) 謹(jǐn) 和 古 板 的Pascal 語 法 感 到 枯 燥 乏 味?!?類 自 動(dòng) 完 成” 向 導(dǎo), 可 以 幫 助 您 快 速 生 成 有 關(guān) 類 的 代 碼。 - 二 是“ 符 號(hào) 預(yù) 知”。 當(dāng) 您 在 設(shè) 計(jì) 期 編 寫 代 碼 時(shí),Delphi 4 在 后 臺(tái) 運(yùn) 行 編 譯 器, 這 樣 您 無 須 顯 式 地 編 譯 代 碼 就 能 看 到 每 個(gè) 符 號(hào) 實(shí) 際 是 怎 樣 存 儲(chǔ) 的, 能 夠 及 時(shí) 地 消 除 錯(cuò) 誤。 - 三 是“ 代 碼 模 板”。 當(dāng) 您 在 設(shè) 計(jì) 期 編 寫 代 碼 時(shí), 經(jīng) 常 要 重 復(fù) 輸 入 諸 如if . then . else 或for . do 等 語 句,Delphi 4 把 一 些 常 用 的 代 碼 結(jié) 構(gòu) 預(yù) 先 做 成 模 板, 您 只 要 選 擇 一 個(gè) 模 板,Delphi 4 就 會(huì) 自 動(dòng) 把 該 模 板 的 代 碼 插 入 到 代 碼 編 輯 器 中。 代 碼 模 板 也 可 以 自 定 義。 - 四 是“ 類 成 員 提 示”。 當(dāng) 您 鍵 入 一 個(gè) 類 名 或 對(duì) 象 名, 再 鍵 入 一 個(gè) 小 圓 點(diǎn),Delphi 4 估 計(jì) 您 要 訪 問 類 的 成 員, 它 就 會(huì) 自 動(dòng) 彈 出 一 個(gè) 列 表 框, 列 出 類 的 所 有 特 性、 方 法 和 事 件, 這 樣 您 就 用 不 著 記 憶 類 有 哪 些 成 員, 也 不 用 查 閱 幫 助 或 手 冊(cè), 更 不 用 擔(dān) 心 寫 錯(cuò) 成 員 的 名 稱。 - 五 是“ 參 數(shù) 提 示”。 您 只 要 鍵 入 例 程 名 或 方 法 名, 再 鍵 入 左 圓 括 號(hào),Delphi 4 就 自 動(dòng) 顯 示 該 例 程 或 方 法 的 所 有 參 數(shù) 名 稱 及 其 數(shù) 據(jù) 類 型, 這 樣 就 能 保 證 參 數(shù) 的 個(gè) 數(shù)、 順 序 和 數(shù) 據(jù) 類 型 總 是 正 確 的。 BusinessInsight- BusinessInsight 是 一 組 數(shù) 據(jù) 分 析 功 能 的 統(tǒng) 稱, 包 括 以 下 幾 個(gè) 方 面: - 一 是DecisionCube, 用 于 對(duì) 數(shù) 據(jù) 進(jìn) 行 全 方 位、 多 層 次 的 分 析。 其 中,TDecisionCube 可 建 立 一 個(gè) 多 維 數(shù) 據(jù) 倉 庫。TDecisionQuery 能 夠 對(duì) 數(shù) 據(jù) 庫 進(jìn) 行 查 詢 并 返 回 查 詢 結(jié) 果, 它 附 帶 的 決 策 查 詢 編 輯 器 可 構(gòu) 造 非 常 復(fù) 雜 的 查 詢。 - 二 是TeeCharts, 以 圖 表 形 式 顯 示 和 分 析 數(shù) 據(jù), 數(shù) 據(jù) 的 來 源 可 以 是 數(shù) 據(jù) 庫。 - 三 是QuickReport, 擅 長 制 作 數(shù) 據(jù) 庫 報(bào) 表, 可 預(yù) 覽 和 打 印。 ActiveInsight- Delphi 4 完 全 支 持ActiveX, 您 可 以 很 方 便 地 創(chuàng) 建、 注 冊(cè)、 安 裝、 發(fā) 布 和 使 用ActiveX 控 件、ActiveForm 和OLE 自 動(dòng) 化 對(duì) 象, 這 應(yīng) 當(dāng) 歸 功 于“ 對(duì) 象 接 口” 技 術(shù) 和DAX 技 術(shù)。 - Delphi 4 內(nèi) 建 了 對(duì)COM 的 支 持, 由 于COM 對(duì) 象 具 有 語 言 和 平 臺(tái) 無 關(guān) 性, 用Delphi 4 創(chuàng) 建 的 對(duì) 象 可 以 與 用Visual Basic、Java、C 及 其 他 語 言 實(shí) 現(xiàn) 的 對(duì) 象 交 互。 在 多 層Client/Server 環(huán) 境 中,COM 對(duì) 象 可 以 封 裝 商 業(yè) 規(guī) 則, 為 分 布 式 的 客 戶 提 供 服 務(wù)。 此 外,Delphi 4 用“ 包” 技 術(shù) 減 少 冗 余 的VCL 框 架 代 碼, 從 而 使 應(yīng) 用 程 序 更 精 巧, 更 適 合 于 在Internet/Intranet 上 傳 輸 和 分 發(fā)。Delphi 4 取 消 了 原 來 的 包 編 輯 器, 改 用 項(xiàng) 目 管 理 器 對(duì) 包 項(xiàng) 目 統(tǒng) 一 進(jìn) 行 管 理。 支 持Internet 應(yīng) 用- Delphi 4 包 含 了 一 組Internet 元 件, 可 以 很 方 便 地 實(shí) 現(xiàn)WinSock 編 程, 訪 問HTTP、UDP、FTP、SMTP、POP3 和NNTP 等 服 務(wù)。 你 可 以 利 用Delphi 4 方 便 地 創(chuàng) 建Web 服 務(wù) 器 應(yīng) 用 程 序, WebBridge 簡 化 了 對(duì)NSAPI 和ISAPI 的 訪 問,WebModules 封 裝 了Web 服 務(wù) 器 的 應(yīng) 用 邏 輯,WebDispatcher 實(shí) 現(xiàn) 了HTTP 請(qǐng) 求 消 息 和HTTP 響 應(yīng) 消 息 的 動(dòng) 態(tài) 調(diào) 度。 運(yùn) 用ActiveForm 技 術(shù) 和Remote DataBroker 技 術(shù) 可 以 把 分 布 式 的Client/Server 結(jié) 構(gòu) 擴(kuò) 展 到Internet/Intranet 上。 開 放 性 與 靈 活 性- Delphi 4 的 開 放 體 系 結(jié) 構(gòu) 支 持 多 個(gè) 數(shù) 據(jù) 庫 引 擎, 任 何 一 個(gè) 數(shù) 據(jù) 庫 引 擎 都 能 與Delphi 4 的 數(shù) 據(jù) 顯 示 控 件 如TDBGrid、TDBEdit 協(xié) 調(diào) 工 作。 - Delphi 4 可 以 訪 問Oracle 的BLOB(Binary Large Object) 型 字 段, 實(shí) 際 的 數(shù) 據(jù) 存 儲(chǔ) 在 外 部 文 件 中。Delphi 4 支 持Oracle 8 的 抽 象 數(shù) 據(jù) 類 型(ADT), 允 許 自 己 定 義 數(shù) 據(jù) 類 型, 自 定 義 的 數(shù) 據(jù) 類 型 可 以 基 于 真 實(shí) 的 類 型, 也 可 以 基 于 已 定 義 的 抽 象 類 型。 這 個(gè) 功 能 的 意 義 是 非 常 重 大 的, 您 可 以 把 任 何 商 業(yè) 對(duì) 象(Business Objects) 存 儲(chǔ) 到 數(shù) 據(jù) 庫 中, 或 者 把Oracle 數(shù) 據(jù) 庫 中 的 商 業(yè) 對(duì) 象 放 到Form 上 顯 示 出 來。 MIDAS- Delphi 4 是 開 發(fā) 多 層Client/Server 應(yīng) 用 程 序 的 最 佳 編 程 工 具, 這 與Inprise 的 發(fā) 展 戰(zhàn) 略 有 關(guān)。MIDAS(Multi Tiered Distributed Application Services) 實(shí) 際 上 是 一 組 分 布 式 技 術(shù) 的 統(tǒng) 稱, 它 包 括 以 下 方 面: - Business Broker 是 一 種 分 布 式 的 對(duì) 象 名 稱 注 冊(cè) 服 務(wù), 它 能 根 據(jù) 當(dāng) 前 的 負(fù) 載 情 況 動(dòng) 態(tài) 地 調(diào) 整 遠(yuǎn) 程 對(duì) 象 的 投 入 和 切 除, 從 而 保 證 關(guān) 鍵 性 的 商 業(yè) 應(yīng) 用 永 不 中 斷。 - OLEnterprise 是 一 個(gè) 把 傳 統(tǒng) 的Client/Server 應(yīng) 用 程 序 向 三 層 結(jié) 構(gòu)“ 遷 移” 的 工 具, 它 能 夠 把 應(yīng) 用 邏 輯 和 數(shù) 據(jù) 訪 問 模 塊 集 中 在 應(yīng) 用 服 務(wù) 器 上 完 成。 - “Remote Data Broker” 是 多 層Client/Server 結(jié) 構(gòu) 的 關(guān) 鍵 技 術(shù), 客 戶 端 只 需 要 實(shí) 現(xiàn) 用 戶 界 面, 而 應(yīng) 用 邏 輯( 又 稱 商 業(yè) 規(guī) 則) 則 由 應(yīng) 用 服 務(wù) 器 實(shí) 現(xiàn), 這 樣 就 達(dá) 到 使 客 戶 端“ 減 肥” 的 目 的, 并 且“ 瘦” 客 戶 端 的 維 護(hù) 成 本 很 低?!癛emote Data Broker” 技 術(shù) 的 另 一 個(gè) 作 用 在 于 它 能 顯 著 地 減 少 網(wǎng) 絡(luò) 上 的 數(shù) 據(jù) 流 量, 這 在 帶 寬 問 題 日 益 嚴(yán) 重 的 今 天 具 有 重 要 的 意 義。 - MIDAS 除 了 能 傳 遞 數(shù) 據(jù) 以 外, 還 能 傳 遞 表 的 結(jié) 構(gòu), 對(duì) 于“ 瘦” 客 戶 來 說, 程 序 員 不 用 寫 任 何 代 碼, 就 能 保 證 表 與 表 之 間 的Master/Detail 關(guān) 系 和 嵌 套 關(guān) 系 得 到 維 護(hù) 和 更 新。 為 了 保 證 系 統(tǒng) 的 安 全 性, 鑒 別 用 戶 身 份( 登 錄) 是 一 種 最 簡 單 而 又 有 效 的 手 段。Delphi 4 內(nèi) 建 了 用 戶 登 錄 功 能, 程 序 員 不 必 為 此 編 寫 額 外 的 代 碼。 - Delphi 4 能 夠 使“ 瘦” 客 戶 端 顯 著 地 加 快 檢 索 數(shù) 據(jù) 的 速 度, 這 是 因 為Delphi 4 采 用 了 一 種“Deferred BLOB” 的 技 術(shù), 它 優(yōu) 先 下 載 非BLOB 型 的 數(shù) 據(jù), 等 非BLOB 型 的 數(shù) 據(jù) 下 載 完 后 再 根 據(jù) 需 要 下 載BLOB 型 數(shù) 據(jù)。 - Delphi 4 在“ 瘦” 客 戶 端 用TMIDASConnection 與 應(yīng) 用 服 務(wù) 器 連 接,TMIDASConnection 支 持 三 種 連 接 方 式:TCP/IP、CORBA 和DCOM, 其 性 能 超 過 了Delphi 3 的TremoteServer。 - 此 外,Delphi 4 還 支 持Microsoft Transaction Server(MTS)。MTS 是Microsoft 為 實(shí) 現(xiàn) 分 布 式 應(yīng) 用 而 設(shè) 計(jì) 的 一 個(gè) 中 間 件, 其 基 本 組 成 部 分 是ActiveX。MTS 中 的“ 兩 階 段 提 交” 技 術(shù) 使 得 應(yīng) 用 程 序 能 夠 跨 服 務(wù) 器 處 理 事 務(wù)。MTS 中 的“X/Open XA” 技 術(shù) 允 許 服 務(wù) 器 與MTS 的 資 源 管 理 器 通 信, 客 戶 程 序 能 夠 在 異 構(gòu) 環(huán) 境 下 看 到 提 交 的 數(shù) 據(jù) 包 成 功 還 是 失 敗。 總 結(jié)- 從 以 上 介 紹 可 看 出,Delphi 4 的 確 很“ 酷”, 對(duì) 于 開 發(fā) 人 員 來 說, 選 擇Delphi 4 是 非 常 明 智 的, 與 其 他 開 發(fā) 工 具 相 比,Delphi 4 的 編 程 效 率 和 應(yīng) 用 程 序 的 性 能 至 少 能 提 高 一 倍, 可 以 這 么 說, 選 擇Delphi 4 意 味 著 軟 件 開 發(fā) 已 經(jīng) 成 功 了 一 半。使用Delphi4開發(fā)各種應(yīng)用程序隨時(shí)、隨處、隨意獲取數(shù)據(jù)的Borland Delphi 4.0Borland 的 MIDAS 技 術(shù) Delphi1.0版本1.1 Delphi 4.0的安裝1.1.1安裝1.1.2 BDE 的安裝1.1.3 自定義VCL1.1.3.1加入構(gòu)件1.1.3.2刪除構(gòu)件1.1.3 文件清單1. 2設(shè)置使用環(huán)境1、 進(jìn)入環(huán)境設(shè)置:Tools|Evironment Options2、 Preferences頁選項(xiàng):l Desktop Contents選項(xiàng):Desktop only:保存當(dāng)前目錄、程序編輯器所打開的文件和打開的窗體等信息。Desktop and symbols:除保存Desktop only選項(xiàng)相同信息外,還保存最后編輯成功的字符信息。l Auto save選項(xiàng):l Form Designer選項(xiàng)(Grid):l Debugging選項(xiàng):1.3 工具1.3.1集成調(diào)試器1.3.2第二部分 Delphi Object Pascal語法2.1 Object Pascal程序的基本框架結(jié)構(gòu)Delphi的應(yīng)用程序主要就是緊緊圍繞著窗體和單元這兩個(gè)部分進(jìn)行的。窗體(Form)是與用戶直接可見的對(duì)象。Delphi程序正是由多個(gè)Forms來組成的。與之相應(yīng)的是單元,它的目的是幫助我們建立一段源程序,用以處理窗體中的相關(guān)操作和設(shè)定。每個(gè)單元對(duì)應(yīng)于一個(gè)Form程序區(qū)段,它包含了事件處理程序、過程和函數(shù)。下面讓我們先看一看Delphi程序的基本框架結(jié)構(gòu):(通過雙擊Form窗件)unit Unit1; 單元標(biāo)題 interface 接口部分 usesSysUtils,WinTypes,WinProcs,Messages,Classes,Graphics,Controls,Forms,Dialogs;type 類型區(qū)段 Tform1=class(TForm)private私有變量聲名putlic公有變量聲名end;var 變量定義區(qū) Form1:TForm1;implementation 實(shí)現(xiàn)部分 $R*DFMend.從上面的程序中可以看出,Delphi程序的一個(gè)單元包括五大部分,即單元標(biāo)題、接口部分、類型區(qū)段、變量定義區(qū)和實(shí)現(xiàn)部分。它們是構(gòu)成Delphi程序的基本框架結(jié)構(gòu)。在這五大部分中,每一部分都有特定的意義。單元標(biāo)題,這是Delphi程序自動(dòng)產(chǎn)生的,通過使用對(duì)象觀察可以改變其名;接口部分,該區(qū)段又叫資源說明段,該段通過USES對(duì)引用Delphi系統(tǒng)提供的資源或用戶自定義的資源進(jìn)行說明;類型區(qū)段,該段定義本單元資源,所定義的代碼變量可供其它單元使用;變量區(qū),該區(qū)定義部分系統(tǒng)或在類型區(qū)段的變量供實(shí)用區(qū)用;實(shí)現(xiàn)部分,又稱程序執(zhí)行過程區(qū),這個(gè)區(qū)是我們編寫事件過程、子程序以及過程等有關(guān)內(nèi)容和過程函數(shù)中使用的變量、常量定義及說明,所有的編程工作均在該區(qū)段的內(nèi)完成,這部分所定義的代碼和變量只能在本單元中使用。2.2 Object Pascal 的內(nèi)部數(shù)據(jù)格式2.2.1 Integer typesAn integer type represents a subset of the whole numbers. The generic integer types are Integer and Cardinal; use these whenever possible, since they result in the best performance for the underlying CPU and operating system. The table below gives their ranges and storage formats for the current 32-bit Object Pascal compiler.TypeRangeFormatInteger*.signed 32-bitCardinal0.unsigned 32-bitFundamental integer types include Shortint, Smallint, Longint, Int64, Byte, Word, and Longword.TypeRangeFormatShortint*128.127signed 8-bitSmallint*32768.32767signed 16-bitLongint*.signed 32-bitInt64*263.263*1signed 64-bitByte0.255unsigned 8-bitWord0.65535unsigned 16-bitLongword0.unsigned 32-bitIn general, arithmetic operations on integers return a value of type Integer梬hich, in its current implementation, is equivalent to the 32-bit Longint. Operations return a value of type Int64 only when performed on an Int64 operand. Hence the following code produces incorrect results.var I: Integer; J: Int64; .I := High(Integer);J := I + 1;To get an Int64 return value in this situation, cast I as Int64: .J := Int64(I) + 1;For more information, see Arithmetic operators.Note:Most standard routines that take integer arguments truncate Int64 values to 32 bits. However, the High, Low, Succ, Pred, Inc, Dec, IntToStr, and IntToHex routines fully support Int64 arguments. Also, the Round, Trunc, StrToInt64, and StrToInt64Def functions return Int64 values. A few routines梚ncluding Ord梒annot take Int64 values at all.When you increment the last value or decrement the first value of an integer type, the result wraps around the beginning or end of the range. For example, the Shortint type has the range *128.127; hence, after execution of the codevar I: Shortint; .I := High(Shortint);I := I + 1;the value of I is *128. If compiler range-checking is enabled, however, this code generates a runtime error.2.2.2 Character typesTopic groupSee alsoThe fundamental character types are AnsiChar and WideChar. AnsiChar values are byte-sized (8-bit) characters ordered according to the extended ANSI character set. WideChar values are word-sized (16-bit) characters ordered according to the Unicode character set. The first 256 Unicode characters correspond to the ANSI characters.The generic character type is Char, which is equivalent to AnsiChar. Because the implementation of Char is subject to change, it抯 a good idea to use the standard function SizeOf rather than a hard-coded constant when writing programs that may need to handle characters of different sizes.A string constant of length 1, such as A, can denote a character value. The predefined function Chr returns the character value for any integer in the range of AnsiChar or WideChar; for example, Chr(65) returns the letter A.Character values, like integers, wrap around when decremented or incremented past the beginning or end of their range (unless range-checking is enabled). For example, after execution of the codevar Letter: Char; I: Integer;begin Letter := High(Letter); for I := 1 to 66 do Inc(Letter);end;Letter has the value A (ASCII 65).2.2.3 Character typesTopic groupDelphi has three character types: Char, AnsiChar, and WideChar.TheChar character type came from Standard Pascal, and was used in Turbo Pascal and then in Object Pascal. Later Object Pascal added AnsiChar and WideChar as specific character types that were used to support standards for character representation on the Windows operating system. AnsiChar was introduced to support an 8-bit character ANSI standard, and WideChar was introduced to support a 16-bit Unicode standard. The name WideChar is used because Unicode characters are also known as wide characters. Wide characters are two bytes instead of one, so that the character set can represent many more different characters. When AnsiChar and WideChar were implemented, Char became the default character type representing the currently recommended implementation. If you use Char in your application, remember that its implementation is subject to change in future versions of Delphi.The following table summarizes these character types:TypeBytesContentsPurposeChar1Holds a single ANSI character.Default character type.AnsiChar1Holds a single ANSI character. 8-bit Ansi character standard on Windows.WideChar2Holds a single Unicode character. 16-bit Unicode standard on Windows.For more information about using these character types, see "Character types*. For more information about Unicode characters, see "About extended character sets*.2.2.4 Real typesTopic groupSee alsoA real type defines a set of numbers that can be represented with floating-point notation. The table below gives the ranges and storage formats for the fundamental real types.TypeRangeSignificant digitsSize in bytesReal482.9 x 10*39 . 1.7 x 103811*126Single1.5 x 10*45 . 3.4 x 10387*84Double5.0 x 10*324 . 1.7 x 1030815*168Extended3.6 x 10*4951 . 1.1 x 10493219*2010Comp*263+1 . 263 *119*208Currency*477.5808. 477.580719*208The generic type Real, in its current implementation, is equivalent to Double.TypeRangeSignificant digitsSize in bytesReal5.0 x 10*324 . 1.7 x 1030815*168Note:The six-byte Real48 type was called Real in earlier versions of Object Pascal. If you are recompiling code that uses the older, six-byte Real type, you may want to change it to Real48. You can also use the $REALCOMPATIBILITY ON compiler directive to turn Real back into the six-byte type.The following remarks apply to fundamental real types.Real48 is maintained for backward compatibility. Since its storage format is not native to the Intel CPU family, it results in slower performance than other floating-point types.Extended offers greater precision than other real types but is less portable. Be careful using Extended if you are creating data files to share across platforms.The Comp (computational) type is native to the Intel CPU and represents a 64-bit integer. It is classified as a real, however, because it does not behave like an ordinal type. (For example, you cannot increment or decrement a Comp value.) Comp is maintained for backward compatibility only. Use the Int64 type for better performance.Currency is a fixed-point data type that minimizes rounding errors in monetary calculations. It is stored as a scaled 64-bit integer with the four least-significant digits implicitly representing decimal places. When mixed with other real types in assignments and expressions, Currency values are automatically divided or multiplied by 10000.2.2.5 Boolean typesTopic groupSee alsoThe four predefined Boolean types are Boolean, ByteBool, WordBool, and LongBool. Boolean is the preferred type. The others exist to provide compatibility with different languages and the Windows environment.A Boolean variable occupies one byte of memory, a ByteBool variable also occupies one byte, a WordBool variable occupies two bytes (one word), and a LongBool variable occupies four bytes (two words).Boolean values are denoted by the predefined constants True and False. The following relationships hold.BooleanByteBool, WordBool, LongBoolFalse < TrueFalse <> TrueOrd(False) = 0Ord(False) = 0Ord(True) = 1Ord(True) <> 0Succ(False) = TrueSucc(False) = TruePred(True) = FalsePred(False) = TrueA value of type ByteBool, LongBool, or WordBool is considered True when its ordinality is nonzero. If such a value appears in a context where a Boolean is expected, the compiler automatically converts any value of nonzero ordinality to True.The remarks above refer to the ordinality of Boolean values梟ot to the values themselves. In Object Pascal, Boolean expressions cannot be equated with integers or reals. Hence, if X is an integer variable, the statementif X then .;generates a compilation error. Casting the variable to a Boolean type is unreliable, but each of the following alternatives will work.if X <> 0 then .; use longer expression that returns Boolean value var OK: Boolean use Boolean variable .if X <> 0 then OK := True;if OK then .;2.2.6 String typesTopic groupSee alsoA string represents a sequence of characters. Object Pascal supports the following predefined string types.TypeMaximum lengthMemory requiredUsed forShortString255 characters2 to 256 bytesbackward compatibilityAnsiString231 characters4 bytes to 2GB8-bit (ANSI) charactersWideString230 characters4 bytes to 2GBUnicode characters; COM servers and interfacesAnsiString, sometimes called the long string, is the preferred type for most purposes.String types can be mixed in assignments and expressions; the compiler automatically performs required conversions. But strings passed by reference to a function or procedure (as var and out parameters) must be of the appropriate type. Strings can be explicitly cast to a different string type (see Typecasts).The reserved word string functions like a generic type identifier. For example,var S: string;creates a variable S that holds a string. In the default $H+ state, the compiler interprets string (when it appears without a bracketed number after it) as AnsiString. Use the $H杴 directive to turn string into ShortString.The standard function Length returns the number of characters in a string. The SetLength procedure adjusts the length of a string.Comparison of strings is defined by the ordering of the characters in corresponding positions. Between strings of unequal length, each character in the longer string without a corresponding character in the shorter string takes on a greater-than value. For example, 揂B* is greater than 揂*; that is, AB > A returns True. Zero-length strings hold the lowest values.You can index a string variable just as you would an array. If S is a string variable and i an integer expression, Si represents the ith character in S. For a ShortString or AnsiString, Si is of type AnsiChar; for a WideString, Si is of type WideChar. The statement MyString2 := A; assigns the value A to the second character of MyString. The following code uses the standard UpCase function to convert MyString to upper-case.var I: Integer;begin I := Length(MyString); while I > 0 do begin MyStringI := UpCase(MyStringI); I := I - 1; end;end;Be careful indexing strings in this way, since overwriting the end of a string can cause access violations. Also, avoid passing long-string indexes as var parameters, because this results in inefficient code.You can assign the value of a string constant梠r any other expression that returns a string梩o a variable. The length of the string changes dynamically when the assignment is made. Examples:MyString := Hello world!;MyString := Hello + world;MyString := MyString + !;MyString := ; space MyString := ; empty string 1.標(biāo)記(TOKEN) 1.1 特別符號(hào)(Symbols) 字母(Letters) : A.Z , a.z 數(shù)字(Digits) : 0.9 十六進(jìn)位數(shù)字(Hex Digits) : 0.9,A.F(OR a.f) 空白(Blank) : ASCII 32 單字元符號(hào):+-*/=<>.,():;$# 多字元符號(hào):<=,>=,:=,.,(*,*),(.,.) 1.2 識(shí)別字(Identifiers) 表示:常數(shù),型態(tài),變數(shù),程序,函數(shù),程式單元,程式,欄位. 長度:63位內(nèi)有效,不分大小寫 字首:字母,_ 識(shí)別字不得重復(fù),若有重復(fù)必需采 限定識(shí)別字 : Name 1.3 標(biāo)箋(Label) : 0.9999 or 識(shí)別字 1.4 字元字串 ATTN - ATTN Youll see - Yoyll see - 空字串 - 空白字元 Line 1#13#10Line 2 - Line 1 Line 2 1.5 注釋 xxxxxxx xxxxxxxx xxxxxx xxxxx / xxxxxxxx2.常數(shù)宣告 (使用標(biāo)記 = ) 2.1一般常數(shù)宣告 CONST Min = 0; Max = 100; Center = ( Max - Min ) Div 2; Blank = Chr(32); NumChr = Ord(Z) - Ord(A) + 1; ErrMsg = Out Of Rang; ErrDtl = Out Of Rang + :Item 10; Numeric = 0.9 ; Alpha = A.Z,a.z; AlphNum = Alpha + Numeric; 2.1型態(tài)常數(shù)(Typed constant)宣告 CONST MaxInt : Integer = 9999; FixReal : Real = -0.12; ListStr : String4 = This; AA : Pchar = abcedf; Dim : Array0.1,0.1,0.1 of Integer = (0,1),(2,3),(4,5),(6,7); Dim(0,0,0) = 0 Dim(0,0,1) = 1 Dim(0,1,0) = 2 Dim(0,1,1) = 3 Dim(1,0,0) = 4 Dim(1,0,1) = 5 Dim(1,1,0) = 6 Dim(1,1,1) = 7 - TYPE Trec = record fl1,fl2 : Integer; end; CONST

注意事項(xiàng)

本文(Delphi參考手冊(cè)0.doc)為本站會(huì)員(小**)主動(dòng)上傳,裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。 若此文所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng)(點(diǎn)擊聯(lián)系客服),我們立即給予刪除!

溫馨提示:如果因?yàn)榫W(wǎng)速或其他原因下載失敗請(qǐng)重新下載,重復(fù)下載不扣分。




關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號(hào):ICP2024067431號(hào)-1 川公網(wǎng)安備51140202000466號(hào)


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺(tái),本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng),我們立即給予刪除!