Time of Update: 2017-02-28
//譬如 WINDIR 是表示系統目錄的系統變數, 可以這樣擷取:var s: string; begin s := GetEnvironmentVariable('WINDIR'); ShowMessage(s); {C:\WINDOWS}end;(*-------------------------------------------------------------------------------- WINDIR {系統目錄 - C:\WINDOWS}
Time of Update: 2017-02-28
Function DecimalToChineseCurrency(Decimal: String): String; Var s, t : TStringList; i, ti : Integer; tmps : String; IsDecimal : Integer; Begin IsDecimal := 0; ti := 0; For i := 1 To Length(Decimal)
Time of Update: 2017-02-28
本例效果圖:代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, OleCtrls, SHDocVw, StdCtrls, ExtCtrls;type TForm1 = class(TForm) WebBrowser1: TWebBrowser; Panel1: TPanel; Button1: TButton; C
Time of Update: 2017-02-28
SysUtils.IsLeapYear();DateUtils.IsInLeapYear();unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); end;var Form1: TFo
Time of Update: 2017-02-28
SysUtils.Now;SysUtils.Date;SysUtils.Time;SysUtils.CurrentYear;unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); end;var Form1
Time of Update: 2017-02-28
Delphi沒有自己的字串分割函數,所以只能程式員自己寫了,網上搜了好多但是真正好用的沒有幾個。下面這個是我在網上找到修改後了的,個人感覺演算法不錯,所以就貼了上來。function SplitString(Source, Deli: string ): TStringList;stdcall;varEndOfCurrentString: byte;StringList:TStringList;beginStringList:=TStringList.Create;while Pos(Deli,
Time of Update: 2017-02-28
Delphi的字元及字串[6] - Char(AnsiChar)、WideChar與其編碼的相互轉換//Char 類型與其編碼值的轉換:var b: Byte; c: Char;begin b := Ord('A'); {返回: 65} b := Ord(#65); {返回: 65} b := Ord($41); {返回: 65} b := Ord(#$41); {返回: 65} b := Byte('A'); {返回: 65} b := Byte(#65); {返回: 65} b :=
Time of Update: 2017-02-28
//String 的指標地址及實際的記憶體位址varstr: string;pstr: PString;pc: PChar;begin{在沒有給 str 賦值以前, 既然聲明了, 就有了指標地址 (@str):}ShowMessage(IntToStr(Integer(@str))); {1244652; 這是在棧中的 str 的指標地址} {但現在還沒有分配真正儲存字串記憶體}ShowMessage(IntToStr(Integer(str))); {0; 0 就是 null}str := '
Time of Update: 2017-02-28
Delphi的字元及字串[2] - Char、AnsiChar、WideChar、PChar、PAnsiChar、PWideChar//單字元 Char、AnsiChar (在目前版本(2007)中, 它們是一回事, 只有 1 位元組大小)varc: Char; {Char 類型的取值範圍是: #0..#255, 用十六進位表示是: #$0..#$FF}begin{ 用十進位方式賦值:}c := #65;ShowMessage(c); {A}{用十六進位方式賦值:}c :=
Time of Update: 2017-02-28
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure FormCreate(Sender: TObject); procedure
Time of Update: 2017-02-28
1.Class Fields//例1 成員變數type TAncestor = class Value: Integer; end; TDescendant = class(TAncestor) Value: string; // hides the inherited Value field end;var MyObject: TAncestor;begin MyObject := TDescendant.Create; MyObject.
Time of Update: 2017-02-28
1.基本指派陳述式Size :=20;Price :=10;2.特殊符號1)單個特殊符號# $ & ' ( ) * + , - . / : ; < = > @ [ ] ^ { }2)成對的特殊符號(* (. *) .) .. // := <= >= <>3).等價的特殊符號 特殊符號 等價的特殊符號 [ (.
Time of Update: 2017-02-28
1.單元和程式(Units和Programs)1)Programsprogram Editor; uses Forms, REAbout, // An "About" box REMain; // Main form {$R *.res} begin Application.Title := 'Text Editor'; Application.CreateForm(TMainForm, MainForm);
Time of Update: 2017-02-28
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls;type TForm1 = class(TForm) RadioGroup1: TRadioGroup; procedure FormMouseDown(Sender: TObject; Button:
Time of Update: 2017-02-28
隨著 Embarcadero 8 月 25 號發布 RAD Studio 2009 (Tiburon) 以來(Tiburon 的 RTM 日期可能要延後到 9 - 10 月),隨著 Tiburon 全面支援 Unicode,現有的 Delphi / C++ Builder 項目要遷移到 Unicode 下應該注意些什麼也成為大家最為關心的問題。Tiburon 對 Unicode 的支援不僅僅是將原來 類型映射為 AnsiString 的 String 類型直接改成 WideString,而是對
Time of Update: 2017-02-28
Delphi利用資料庫實現檔案打包的基本思路分析:【1】在Delphi中,把檔案讀取為檔案流,再以流的形式儲存在資料庫的OLE 對象的欄位中;【2】當要釋放檔案包時,可以直接讀取資料庫的OLE
Time of Update: 2017-02-28
1.讀硬碟序號function GetDiskSerial(DiskChar: Char): string;varSerialNum : pdword;a, b : dword;Buffer : array [0..255] of char;beginresult := "";if GetVolumeInformation(PChar(diskchar+":\"), Buffer, SizeOf(Buffer), SerialNum,a, b, nil,
Time of Update: 2017-02-28
不管是通過支援 GPS 的智能手機尋找最近的咖啡館,還是通過社交網站尋找附近的朋友,或是查看特定城市中運輸某種商品的所有貨車,越來越多的人和企業都使用位置感知的搜尋服務。建立位置感知搜尋服務通常屬於昂貴的專用解決方案的一部分,並且一般由地理空間專家完成。不過,很流行的開源搜尋庫 Apache Lucene 和強大的 Lucene 搜尋伺服器 Apache Solr
Time of Update: 2017-02-28
在行動裝置 App程式中使用進階對話方塊以及與裝置相關的特性MultiPageDialog、QueryDialog、TimedMessageBox、MobileDevice、Screen 和 Input簡介本系列的 eSWT 移動擴充簡介,第 1 部分:使用簡單小組件快速構建行動裝置 App程式 “使用簡單小組件快速構建行動裝置 App程式”
Time of Update: 2017-02-28
除了在 IBM System z™ 平台之上提供一流的 J2EE™ 應用程式運行時以外,IBM® WebSphere® Application Server for z/OS® 還經過了最佳化,以利用作為當今企業 SOA 環境中的核心引擎的 System z 的獨特技術優勢。WebSphere Application Server for z/OS 的最重要獨特功能之一是面向目標的工作負載管理功能。引言運行在 z/OS 上的 J2EE