Time of Update: 2018-12-07
將釋放寫在子表單的FORMCLOSE()裡面procedure TFormLogin.FormClose(Sender: TObject; var Action: TCloseAction);begin Action := caFree; FormLogin := nil;end; 關閉TABSHEET的時候,遍曆找到它裡面的表單,然後調用表單的close()方法procedure TFormMain.CloseTabsheet;var i: Integer; begin if
Time of Update: 2018-12-07
主程式裝載指令碼procedure TForm1.FormCreate(Sender: TObject);begin fsScript1.Clear; fsScript1.Parent := fsGlobalUnit; fsScript1.AddComponent(Form1); fsScript1.Lines.LoadFromFile('1.txt'); fsScript1.Run;end; 1.txt檔案uses 'lang.txt'; //引用公用的語言單元 procedure
Time of Update: 2018-12-07
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Timer1: TTimer; procedure Timer1Timer(Sender:
Time of Update: 2018-12-07
uses ehlibado; 改良dbgrideh的文字過濾,原先過慮需要填%字串%,修改後,直接填入所要搜尋的字串即可,相關代碼: procedure TSTColumnFilterEh.InternalSetExpressionStr(const Value: String); procedure SetLookupKeyValues(var v: Variant); var i: Integer; begin if
Time of Update: 2018-12-07
試用版本沒有源碼,每次運行之前會提示“要註冊”的資訊,沒有使用的時間限制,可以用。缺點:拖放上去的控制項不能設定其屬性,只好在指令碼裡面設定。unit ToolForm;{$DEFINE EHLIB} // 增加支援EHLIB ADD BY CXG{$DEFINE RAIZE} // 增加支援RAIZE ADD BY CXG{$DEFINE DBANYWHERE} // 增加支援DBANYWHERE ADD BY CXGinterfaceuses Windows,
Time of Update: 2018-12-07
下面例舉一個典型的模板:1.今天是____年__月__日,農曆_______,距離______還有_____天。今天節目的主要內容有:_____、_____、______。下面請聽詳細內容。2. ____在釣魚台國賓館親切會見了____,雙方進行了親切友好的會談。____高度讚賞了____,並對____一貫堅持“一個中國”的原則表示感謝。3. ____出訪____,會見了____,_______高度讚揚中__兩國關係,對____表示歡迎,並強烈譴責了___國家____的做法。4.
Time of Update: 2018-12-07
在Footer的第一列顯示[合計:] 加一個Summary項,Column設為Grid的第一列,Kind設為skNone 在該Summary項的OnGetText事件中,輸入: procedure TFormExpense.tvExpenseTcxGridDBDataControllerTcxDataSummaryFooterSummaryItems2GetText( Sender: TcxDataSummaryItem; const AValue: Variant; AIsFooter:
Time of Update: 2018-12-07
1.伺服器端: type TMSG001 = Packed Record //定義記錄類型 userId: array[0..19] of char; password: array[0..17] of char; end; PSendMSG=^TMSG001;//定義指標類型 var pSend: PSendMSG;//定義指標 pSend^.userId := '001';//產生要發送資料pSend^.password
Time of Update: 2018-12-07
注意:同樣引用 Contnrs -------------------------procedure TForm1.Button1Click(Sender: TObject);var a:TStack; s1,s2:string; p:^string;begin a:=TStack.Create; s1:='Hello'; s2:='Word'; a.Push(@s1); a.Push(@s2); while a.Count <> 0 do
Time of Update: 2018-12-07
一、使用TfrxReport 組件工作1、載入並儲存報表預設情況下,報表表單同項目表單構儲存在同一個DFM檔案中。多數情況下,無須再操作,因而你就不必採用特殊方法載入報表。如果你決定在檔案中儲存報表表單或者是資料庫的Blob欄位(他提供了非常大的彈性,你能夠在非編譯器中修改),你必須使用“TfrxReport”提供的載入和儲存方法。function LoadFromFile(const FileName: String; ExceptionIfNotFound: Boolean = False)
Time of Update: 2018-12-07
三方控制項,通過使用IMPORT TOOL FOR SCRIPTER產生AP_XXX.PAS檔案。在下面的例子中,增加對TPrintDBGridEh的支援。unit myScript;{$DEFINE PRINTDBGRIDEH}{$DEFINE XPMAN}interfaceimplementationuses ap_DB, ap_DBGrids, ap_Controls, ap_Forms, ap_Windows, ap_SysUtils, ap_Messages, ap_Menus,
Time of Update: 2018-12-07
========================================================================== 在主從TableView中根據主TableView得到對應的從TableView var ADetailDC: TcxGridDataController; AView: TcxCustomGridTableView; begin with cxGrid1DBTableView1.DataController do ADetailDC :=
Time of Update: 2018-12-07
TMS Scripter:支援Pascal和VBScript兩種文法。優點是文檔齊全、例子齊全,指令碼可直接支援DLL,官方還提供了豐富的IDE Debug工具、單元匯出函數工具等,缺點是編譯運行較慢。for 空迴圈1000萬次,需要10秒鐘以上。TMS Scripter是商業共用軟體。 FastScript:用過FastReport報表的同學都知道FastReport速度非常快。for
Time of Update: 2018-12-07
本例示範:宿主程式(exe)只有介面的設計,商務規則全部放在指令檔裡面。這個指令檔是個純文字檔案,可以隨意修改。一旦運行宿主程式就會裝載指令檔裡面的指令碼形式的商務規則。這樣,商務規則很容易被修改。 宿主單元:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, atScript, atPascal, StdCtrls,
Time of Update: 2018-12-07
經常有人提問:說自己的項目是由許多DLL打包方式組織的,各個DLL之間的對象如何共用訪問? 這其實很簡單:只要共用對象建立後,把它的指標儲存進一個大家都可以訪問 的地方,需要的時候就去取。 我說用INI檔案暫存共用對象指標也行。為了證明特別寫了幾行代碼: uses inifiles;procedure TForm1.Button2Click(Sender: TObject);var ini: tinifile; h: integer;begin ini :=
Time of Update: 2018-12-07
凡是指令碼中使用的類,控制項,方法,函數都要先行註冊以後,指令碼才能識別這些對象。本人使用的是scripter studio pro 1.2,發現官方只提供了DELPHI本身所提供的控制項的指令碼支援檔案。那麼指令碼中需要使用第三方的控制項怎麼辦?幸好TMS提供了方便的專用工具:import tool for Scripter Studio,在TMS的官方網站提供下載。The import tool for Scripter Studio parses Delphi source code
Time of Update: 2018-12-07
1、控制POS機的客戶顯示屏procedure TFrmMain.ShowMoney(Money_Port: String;Money_String:String);//Moneey_Port 顧顯介面Com1 or Com2 Money_String 顧顯顯示的內容var PrnFileName:TextFile;begin Assignfile(PrnFileName,Money_Port);
Time of Update: 2018-12-07
根據.DFM檔案動態產生表單之前要先註冊表單中使用到的類。在指令碼中要使用表單中的控制項對象之前也要先註冊這些控制項對象。 unit UClass;{$DEFINE EHLIB}{$DEFINE RAIZE}{$DEFINE DBANYWHERE}{$DEFINE TMS}interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
Time of Update: 2018-12-07
宿主的功用:裝載.dfm檔案動態產生表單;註冊動態產生表單中的類,對象,屬性,方法,函數,從而讓指令碼引擎能夠操作它們。 下面以TMS SCRIPTER STUDIO為例: unit uMain;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, atScript, atPascal;type TFormMain =
Time of Update: 2018-12-07
procedure TForm1.Button1Click(Sender: TObject);varRPrinter:TextFile;i:integer;begin{設定印表機}Assignfile(RPrinter,'lpt1');{準備寫檔案}Rewrite(RPrinter);{列印}for i := 0 to memo1.lines.Count - 1