PB代碼動態解析執行器

 

當你看到VB、VFP等開發語言提供的強大的宏執行功能,是否是很羨慕呢?當你尋遍PB的幫助、關於PB開發的書籍或網站而不可得的時候,是否是感到有一絲的遺憾?若是你看到這篇文章,你應該感到振奮,由於你終於能夠解決這個問題,並且解決問題的思路既是如此簡單、代碼既是如此簡短。若是再加上你的智慧,應該比個人解決方法更漂亮。 程序員

先讓咱們來了解一些基本知識。 sql

一.代碼的載體 編程

在PB中,只有三個地方能夠存放代碼,那就是函數、事件、屬性。這裏所指的函數包括有返回值的一般意義下的函數和無返回值的過程以及聲明的WINAPI函數,所指的事件指在對象中定義的處理程序,所指的屬性指PB系統屬性以外的實例變量、共享變量、全局變量。函數和事件是能夠用來調用執行的,屬性則只能用來賦值和取值。一般咱們是在函數或事件中編寫代碼。 數組

二.對象的建立 app

若是對象類型是已知的,可使用CREATE objecttype 來建立對象,若是對象類型是動態的,可使用CREATE USING objecttypestring來建立對象。 框架

三.對象函數的調用方式 ide

若是調用一個已知類型的對象的函數或事件,一般採用靜態模式,也可採用動態模式,若是調用一個動態建立的對象的函數或事件,則必須採用動態模式,不然編譯出錯。採用動態模式調用函數是在函數前加dynamic 關鍵字。讀者可查閱PB幫助。 函數

四.庫文件的搜索 oop

PB中用於編程的對象是保存在PBL、PBD、DLL中的,若是想要使庫文件中的對象在應用程序運行時有效,經常使用的方法是直接將該PBL編譯進去或者說使該PBL在庫搜索列表中。若是須要在運行狀態下改變庫文件搜索列表,PB提供了SetLibraryList和AddToLibraryList兩個函數。SetLibraryList函數只能在應用對象的open事件腳本中使用,不然應用程序會崩潰,AddToLibraryList爲PB9新增的函數,用於將新文件加入到庫文件搜索列表中,這兩個函數都是隻能在編譯環境下有效。 性能

五.PB庫文件的建立與銷燬

PB提供了LibraryCreate函數用於建立庫文件,提供LibraryDelete、FileDelete函數用於刪除庫文件。

六.PB實體的導入

PB提供了LibraryImport函數用於根據對象語法建立PB實體並導入到庫文件中,但該函數目前只支持數據窗口對象類型的導入。不過,PB提供了相應的WINAPI函數支持其它類型實體的導入,這些相關的WINAPI包括在PBORCX0.DLL中(不一樣的PB版本有不一樣的文件名稱,如PBORC90.DLL、PBORC80.DLL)。有關實體的導入的WINAPI包括PBORCA_SessionOpen、PBORCA_SessionClose、PBORCA_SessionSetLibraryList、PBORCA_SessionSetCurrentAppl、PBORCA_CompileEntryImport等,讀者能夠到Sybase網站找ORCA Guide相應文章尋求支持。

七.PB實體的查找

使用FindClassDefinition或FindFunctionDefinition或LibraryDirectory能夠在庫文件中查找PB實體是否存在,使用FindClassDefinition或FindFunctionDefinition性能要好。

如下講開發思路。

一.建立臨時庫文件
1. 取臨時目錄做爲庫文件的存放目錄
2. 取待建立的臨時庫文件名稱,保證不與已有文件重名
3. 使用LibraryCreate函數建立臨時庫文件

二.構造用於導入庫文件的臨時PB實體語法
1. 取臨時PB實體名稱,保證不與庫文件列表中已有PB實體重名
2. 構造臨時PB實體語法,區分函數和過程

三.將臨時PB實體導入臨時庫文件
1. 取庫文件列表和應用對象所在pbl
2. 將實際不存在的庫文件從庫文件列表中刪除,目的是使調用PBORCA_SessionSetLibraryList成功
3. 調用PBORCA_CompileEntryImport將臨時PB實體導入臨時庫文件

四.將臨時庫文件加入到庫文件搜索列表
1. 調用AddToLibraryList加入新文件到庫文件搜索列表

五.建立臨時PB實體所對應的對象並調用其函數以執行動態腳本
1. 使用CREATE USING objecttypestring語句建立對象
2. 經過動態調用對象的of_exec函數執行動態腳本,區分返回值類型

六.銷燬全部臨時對象
1. 調用LibraryDelete函數刪除建立的臨時庫文件

如下講我在開發時遇到的一些矛盾或問題。

一.代碼是逐行解釋仍是讓PB編譯器去解釋
有些開發人員試圖對動態腳本自行逐行解釋,這是很困難的事情。一行代碼若是脫離它的語境去執行,可能會產生錯誤的結果,即使你對PB所支持的函數所有作出解釋,使用PB開發出來的對象、函數、事件等,你又如何去解釋?這等同於你要花很大力氣去編寫一個PB編譯器,除非你與PB編譯器的開發團隊合做,不然你很難得到成功。因此你必須想辦法讓PB編譯器去解釋。既然每行代碼不能脫離其它代碼而執行,那就建立一個函數或事件,讓這個函數或事件包括你想寫的全部代碼。而函數或事件又不能脫離對象而存在,因此你必須想辦法動態建立對象以及函數或事件,對象的聲明必須依賴於庫文件中的PB實體,由此推出關鍵是建立PB實體。

二.如何建立PB實體
前面已講過要使用PBORCX0.DLL中的WINAPI函數來建立並導入實體,這項技術並不難,在sybase的網站或隨便狗狗(百度)一下就能出來一大把。

三.建立的PB實體是存放在現有庫文件中仍是新文件中再導入
我最初的想法是放在現有庫文件中,這樣就沒必要花費時間在建立庫文件和刪除庫文件的執行上,結果發現,建立是成功,但運行時PB就是不「認識」我建立的PB實體,一建立該實體的對象就報錯,想來PB在程序啓動時就讀取庫文件中有哪些實體造成列表,在沒有改變庫文件列表以前,其實體列表不會改變,這樣對新建的實體就視而不見了。因此我不得不試着新建一個PBL,在新建的PBL中建立PB實體,而後使用AddToLibraryList將新建的PBL包括進來,這一試果真成功。

四.使用數據窗口的Describe調用全局函數仍是其它方式來取得返回值
你們都知道,使用數據窗口的Describe函數能夠調用全局函數,可是它有不少的侷限性,全局函數必須有簡單類型的返回值,全部參數只能是簡單數據類型並且不能經過參考傳值。若是在須要調用的地方直接使用新建對象的函數將不受這些限制。

五.如何進行垃圾對象的清理
既然每次執行動態腳本要建立PB實體,若是執行得多了,就有不少垃圾對象,因此應進行清理。能夠經過LibraryDelete函數或FileDelete刪除庫文件。有意思的是,一旦建立PB實體,即使你刪除了,使用FindClassDefinition或FindFunctionDefinition仍是可以找到,但你想使用該實體建立對象則失敗,這再次說明PB在程序啓動時就讀取庫文件中有哪些實體造成列表,在沒有改變庫文件列表以前,其實體列表不會改變。

如下是所附代碼的幾點說明

一.所附代碼是在PB9環境下開發的,程序運行時必須有PBORC90.DLL,若是改爲PB其它版本,請將nvo_pbcompiler中WINAPI函數所使用的動態庫作相應修改。

二.nvo_pbcompiler用於建立PB實體,這是PB動態腳本解釋器的核心函數;f_execpbscript()用於執行一段PB腳本的樣例代碼函數,返回值類型爲字符串,若是要使用到其它場合,讀者可自行編寫函數,思路相似;w_pbcompiler_test爲一個用來執行PB腳本的樣例界面窗口;其它函數有各自功能。

三.若是想運行PB動態腳本編譯器,請先將全部代碼分對象導入庫文件,而後編譯,PB動態腳本編譯器在PB開發環境下無效。

四.爲了程序方面的簡化,有些所使用的全局函數請參考做者的其它文章。

五.所附代碼僅爲腳本沒有參數的狀況下有效,若是你想代碼有參數,只須要簡單地對腳本語法做些改變就可,固然前臺須要用戶定義參數。

六.本PB動態腳本解釋器可執行全部有效的PB代碼,例如訪問全局變量、使用PB全部的系統函數、使用程序員開發的自定義函數、打開窗口、訪問菜單、使用數據窗口等。

七.一般將本PB動態腳本解釋器嵌入到現有的使用PB開發出來的系統而不是單獨使用,這樣能夠加載不少免編譯的外掛程序。

八.若是再拓寬它的應用範圍,你甚至能夠作到只須要一個框架程序,其它代碼所有動態加載和執行,這樣就只需一次編譯,升級和維護就變得很是簡單,不過你要考慮系統的可用性、系統性能和系統的穩定性等。

附完整源代碼一.pbcompiler$PBExportHeader$pbcompiler.sra$PBExportComments$PB動態腳本解釋器應用對象forwardglobal type pbcompiler from applicationend typeglobal transaction sqlcaglobal dynamicdescriptionarea sqldaglobal dynamicstagingarea sqlsaglobal error errorglobal message messageend forwardglobal variablesend variablesglobal type pbcompiler from applicationstring appname = "pbcompiler"end typeglobal pbcompiler pbcompileron pbcompiler.createappname="pbcompiler"message=create messagesqlca=create transactionsqlda=create dynamicdescriptionareasqlsa=create dynamicstagingareaerror=create errorend onon pbcompiler.destroydestroy(sqlca)destroy(sqlda)destroy(sqlsa)destroy(error)destroy(message)end onevent open;open(w_pbcompiler_test)end event二.f_execpbscript$PBExportHeader$f_execpbscript.srf$PBExportComments$執行動態腳本的樣例函數global type f_execpbscript from function_objectend typeforward prototypesglobal function string f_execpbscript (string as_returntype, string as_pbscript)end prototypesglobal function string f_execpbscript (string as_returntype, string as_pbscript);/*******************************************************************函數名稱:f_execpbscript()參數: as_returntype string 返回值類型as_pbscript string 動態代碼返回值: string 用戶自定義或錯誤信息功能描述:執行動態代碼(只返回字符串)建立人: 康劍民建立日期:2007-02-12版本號: V1.0*******************************************************************/nvo_pbcompiler lnv_pbcompilernonvisualobject luo_pbcompilerstring ls_entryname,ls_librarynamestring ls_returnany la_returnlnv_pbcompiler = create nvo_pbcompiler//建立實體對象if lnv_pbcompiler.of_createentry(as_returntype,as_pbscript,ls_libraryname,ls_entryname) = 1 thenif not isnull(FindClassDefinition(ls_entryname) ) thenluo_pbcompiler = create using ls_entrynamechoose case lower(as_returntype)case 'any','blob','boolean','char','character','date','datetime','dec','decimal','double','int','integer','long','real','string','time','uint','ulong','unsignedint','unsignedinteger','unsignedlong'la_return = luo_pbcompiler.dynamic of_exec()//執行動態代碼ls_return = string(la_return)case '','none'luo_pbcompiler.dynamic of_exec()//執行動態代碼ls_return = "none"case elseluo_pbcompiler.dynamic of_exec()//執行動態代碼ls_return = "result is disabled"end chooseif isvalid(luo_pbcompiler) then destroy luo_pbcompilerelsels_return = "error"end ifelsels_return = "error"end ifif isvalid(lnv_pbcompiler) then destroy lnv_pbcompilerLibraryDelete(ls_libraryname)return ls_returnend function三.f_parse$PBExportHeader$f_parse.srf$PBExportComments$分解字符串到數組global type f_parse from function_objectend typeforward prototypesglobal function long f_parse (readonly string as_text, readonly string as_sep, ref string as_list[])end prototypesglobal function long f_parse (readonly string as_text, readonly string as_sep, ref string as_list[]);/*******************************************************************函數名稱:f_parse()參數: as_text string 來源字符串as_sep string 分隔字符as_list[] ref string 分析後造成的字符串數組返回值: long 分析後造成的數組元素個數功能描述:分析字符串到一個數組中建立人: 康劍民建立日期:2002-11-19版本號: V1.0*******************************************************************/long i,ll_posstring ls_null[],ls_textls_text = as_textas_list = ls_nulli=0ll_pos = posw(lower(ls_text),lower(as_sep))do while ll_pos > 0i ++as_list[i]=leftw(ls_text,ll_pos - 1)ls_text=midw(ls_text,ll_pos + lenw(as_sep),lenw(ls_text))ll_pos = posw(lower(ls_text),lower(as_sep))loopas_list[i + 1] = ls_textreturn upperbound(as_list[])end function四.f_replacetext$PBExportHeader$f_replacetext.srf$PBExportComments$替換字符串global type f_replacetext from function_objectend typeforward prototypesglobal function string f_replacetext (readonly string as_source, readonly string as_oldtag, readonly string as_newtag, readonly long al_seq)end prototypesglobal function string f_replacetext (readonly string as_source, readonly string as_oldtag, readonly string as_newtag, readonly long al_seq);/*******************************************************************函數名稱:f_replacetext()參數: as_source string 源字符串as_oldtag string 待替換特徵字符串as_newtag string 替換後特徵字符串al_seq long 第幾個特徵替換字符串需替換,0表示所有返回值: string 替換後字符串功能描述:用一特徵字符串替換指定字符串中的特徵字符串,參數al_seq=0時表示所有替換建立人: 康劍民建立日期:2002-11-19版本號: V1.0*******************************************************************/long ll_start_pos=1,ll_len_old_tag,i = 0string ls_left,ls_return='',ls_source=''ls_source = as_sourcell_len_old_tag = lenw(as_oldtag)ll_start_pos = posw(lower(ls_source),lower(as_oldtag),1)if al_seq = 0 thenDO WHILE ll_start_pos > 0ls_left = leftw(ls_source,ll_start_pos - 1) + as_newtagls_return = ls_return + ls_leftls_source = midw(ls_source,ll_start_pos + lenw(as_oldtag),lenw(ls_source))ll_start_pos = posw(lower(ls_source),lower(as_oldtag),1)LOOPelseif al_seq > 0 thenDO WHILE ll_start_pos > 0i ++if al_seq = i thenls_left = leftw(ls_source,ll_start_pos - 1) + as_newtagls_return = ls_return + ls_leftls_source = midw(ls_source,ll_start_pos + lenw(as_oldtag),lenw(ls_source))ll_start_pos = posw(lower(ls_source),lower(as_oldtag),1)end ifloopend ifls_return = ls_return + ls_sourcereturn ls_returnend function五.nvo_pbcompiler$PBExportHeader$nvo_pbcompiler.sru$PBExportComments$PB動態腳本解釋器forwardglobal type nvo_pbcompiler from nonvisualobjectend typeend forwardglobal type nvo_pbcompiler from nonvisualobjectend typeglobal nvo_pbcompiler nvo_pbcompilertype prototypes//打開一個會話Function long SessionOpen () Library "PBORC90.DLL" Alias for "PBORCA_SessionOpen"//關閉一個會話Subroutine SessionClose ( long hORCASession ) Library "PBORC90.DLL" Alias for "PBORCA_SessionClose"//設置當前會話的庫清單Function int SessionSetLibraryList ( long hORCASession, ref string pLibNames[], int iNumberOfLibs) Library "PBORC90.DLL" Alias for "PBORCA_SessionSetLibraryList"//設置當前會話對應的應用Function int SessionSetCurrentAppl ( long hORCASession, string lpszApplLibName, string lpszApplName ) Library "PBORC90.DLL" Alias for "PBORCA_SessionSetCurrentAppl"//導入並編譯實體Function int CompileEntryImport ( long hORCASession, string lpszLibraryName, string lpszEntryName, long otEntryType, string lpszComments, string lpszEntrySyntax, long lEntrySyntaxBuffSize, long pCompErrorProc, long pUserData ) Library "PBORC90.DLL" Alias for "PBORCA_CompileEntryImport"//取臨時目錄Function long GetTempPath(long nBufferLength, ref string lpBuffer) Library "kernel32" Alias for "GetTempPathA"//獲取一個已裝載模板的完整路徑名稱FUNCTION ulong GetModuleFileName(ulong hModule,ref string lpFileName,ulong nSize) LIBRARY "kernel32.dll" ALIAS FOR "GetModuleFileNameA"end prototypestype variablesend variablesforward prototypespublic function string of_gettemppath ()public function string of_getapppath ()public function integer of_createentry (string as_returntype, string as_pbscript, ref string as_libraryname, ref string as_entryname)end prototypespublic function string of_gettemppath ();/*******************************************************************函數名稱:of_gettemppath()參數: 無返回值: string 臨時路徑功能描述:取臨時路徑建立人: 康劍民建立日期:2006-12-26版本號: V1.0*******************************************************************/string ls_pathulong lu_size=256ls_path=space(256)GetTempPath(lu_size,ls_path)return trimw(ls_path)end functionpublic function string of_getapppath ();/*******************************************************************函數名稱:of_getapppath()參數: 無返回值: string 應用程序路徑功能描述:取應用程序路徑建立人: 康劍民建立日期:2002-11-22版本號: V1.0*******************************************************************/string ls_apppathls_apppath=space(256)GetModuleFileName(Handle(GetApplication()),ls_apppath,256)ls_apppath=Reverse(ls_apppath)ls_apppath=Reverse(midw(ls_apppath,posw(ls_apppath,'/',1)))return ls_apppathend functionpublic function integer of_createentry (string as_returntype, string as_pbscript, ref string as_libraryname, ref string as_entryname);/*******************************************************************函數名稱:of_createentry()參數: as_returntype string 返回值類型as_pbscript string 動態代碼as_libraryname ref string 建立的庫文件名稱as_entryname ref string 建立的實體名稱返回值: long 是否成功(1表示成功,-1表示失敗)功能描述:根據動態代碼建立實體建立人: 康劍民建立日期:2007-02-12版本號: V1.0*******************************************************************/long ll_sid//會話編號long ll_index//對象序號string ls_librarylist[]//庫文件列表string ls_librarylist_tmp[]//庫文件列表(臨時)string ls_temp_libraryname//臨時庫文件名稱string ls_temp_path//臨時目錄string ls_syntax//實體語法string ls_app_libraryname//應用程序所在庫文件名稱integer li_result//結果string ls_entryname//對象名稱classdefinition lcd_app//應用程序類定義對象string ls_librarylist_files//庫文件integer i,j//臨時變量//開發環境下直接退出if handle(GetApplication()) <= 0 then return -1//取庫文件列表ls_librarylist_files = getlibrarylist ()//取應用對象所在pbllcd_app = getapplication().classdefinitionls_app_libraryname = lcd_app.librarynamels_temp_path = this.of_gettemppath( )//取臨時目錄//取待建立的臨時庫文件名稱ll_index = 1ls_temp_libraryname = ls_temp_path + "temp"+string(ll_index) + ".pbl"do while fileexists(ls_temp_libraryname) or posw(","+ls_librarylist_files+",",","+ls_temp_libraryname+",") > 0ll_index ++ls_temp_libraryname = ls_temp_path + "temp"+string(ll_index) + ".pbl"loop//建立臨時庫文件LibraryCreate(ls_temp_libraryname,"臨時庫文件")f_parse(ls_librarylist_files,',',ls_librarylist)//分解字符串到數組//判斷庫文件是否存在並造成新列表j = 0for i = 1 to upperbound(ls_librarylist)if fileexists(ls_librarylist[i]) thenj ++ls_librarylist_tmp[j] = ls_librarylist[i]end ifnextls_librarylist = ls_librarylist_tmpls_librarylist[upperbound(ls_librarylist)+1] = ls_temp_librarynamell_sid = SessionOpen()//打開一個會話//設置當前會話的庫清單li_result = SessionSetLibraryList (ll_sid, ls_librarylist, upperbound(ls_librarylist))if li_result = 0 then//設置當前會話對應的應用li_result = SessionSetCurrentAppl (ll_sid, ls_app_libraryname, getapplication().appname )if li_result = 0 then//取實體名稱(保證不重複)ll_index = 1do while not isnull(FindClassDefinition("nvo_"+string(ll_index)))ll_index ++loopls_entryname = "nvo_"+string(ll_index)//實體聲明ls_syntax = "$PBExportHeader$"+ls_entryname+".sru"+"~r~n"&+ "forward"+"~r~n"&+ "global type "+ls_entryname+" from nonvisualobject"+"~r~n"&+ "end type"+"~r~n"&+ "end forward"+"~r~n"&+ "~r~n"&+ "global type "+ls_entryname+" from nonvisualobject"+"~r~n"&+ "end type"+"~r~n"&+ "global "+ls_entryname+" "+ls_entryname+""+"~r~n"&+ "~r~n"&+ "forward prototypes"+"~r~n"//區分函數仍是過程if trimw(lower(as_returntype)) = 'none' or trimw(lower(as_returntype)) = '' thenls_syntax = ls_syntax + "public subroutine of_exec ()"+"~r~n"&+ "end prototypes"+"~r~n"&+ "~r~n"&+ "public subroutine of_exec ();"+as_pbscript+"~r~n"&+ "end subroutine"elsels_syntax = ls_syntax + "public function " + as_returntype + " of_exec ()"+"~r~n"&+ "end prototypes"+"~r~n"&+ "~r~n"&+ "public function " + as_returntype + " of_exec ();"+as_pbscript+"~r~n"&+ "end function"end if//實體語法尾部ls_syntax = ls_syntax + "~r~n" + "on " + ls_entryname + ".create"+"~r~n"&+ "call super::create"+"~r~n"&+ "TriggerEvent( this, ~"constructor~" )"+"~r~n"&+ "end on"+"~r~n"&+ "~r~n"&+ "on " + ls_entryname + ".destroy"+"~r~n"&+ "TriggerEvent( this, ~"destructor~" )"+"~r~n"&+ "call super::destroy"+"~r~n"&+ "end on"//導入並編譯實體li_result = CompileEntryImport (ll_sid, ls_temp_libraryname, ls_entryname, 6 , "comment - new object", ls_syntax, len(ls_syntax), 0, 0 )end ifend ifSessionClose(ll_sid)//關閉一個會話as_libraryname = ls_temp_librarynameas_entryname=ls_entryname//加入新文件到庫文件搜索列表AddToLibraryList(ls_temp_libraryname)if li_result = 0 thenreturn 1elsereturn -1end ifend functionon nvo_pbcompiler.createcall super::createTriggerEvent( this, "constructor" )end onon nvo_pbcompiler.destroyTriggerEvent( this, "destructor" )call super::destroyend on六.w_pbcompiler_test$PBExportHeader$w_pbcompiler_test.srw$PBExportComments$PB動態腳本解釋器測試窗口forwardglobal type w_pbcompiler_test from windowend typetype st_returnvalue from statictext within w_pbcompiler_testend typetype st_returntype from statictext within w_pbcompiler_testend typetype st_script from statictext within w_pbcompiler_testend typetype sle_returnvalue from singlelineedit within w_pbcompiler_testend typetype cb_exit from commandbutton within w_pbcompiler_testend typetype sle_returntype from singlelineedit within w_pbcompiler_testend typetype mle_script from multilineedit within w_pbcompiler_testend typetype cb_ok from commandbutton within w_pbcompiler_testend typeend forwardglobal type w_pbcompiler_test from windowinteger width = 1979integer height = 1100boolean titlebar = truestring title = "PB腳本解釋器(測試)"boolean controlmenu = trueboolean minbox = trueboolean maxbox = trueboolean resizable = truelong backcolor = 67108864string icon = "AppIcon!"boolean center = truest_returnvalue st_returnvaluest_returntype st_returntypest_script st_scriptsle_returnvalue sle_returnvaluecb_exit cb_exitsle_returntype sle_returntypemle_script mle_scriptcb_ok cb_okend typeglobal w_pbcompiler_test w_pbcompiler_testtype prototypesend prototypestype variablesend variableson w_pbcompiler_test.createthis.st_returnvalue=create st_returnvaluethis.st_returntype=create st_returntypethis.st_script=create st_scriptthis.sle_returnvalue=create sle_returnvaluethis.cb_exit=create cb_exitthis.sle_returntype=create sle_returntypethis.mle_script=create mle_scriptthis.cb_ok=create cb_okthis.Control[]={this.st_returnvalue,&this.st_returntype,&this.st_script,&this.sle_returnvalue,&this.cb_exit,&this.sle_returntype,&this.mle_script,&this.cb_ok}end onon w_pbcompiler_test.destroydestroy(this.st_returnvalue)destroy(this.st_returntype)destroy(this.st_script)destroy(this.sle_returnvalue)destroy(this.cb_exit)destroy(this.sle_returntype)destroy(this.mle_script)destroy(this.cb_ok)end ontype st_returnvalue from statictext within w_pbcompiler_testinteger x = 9integer y = 608integer width = 297integer height = 60integer textsize = -9integer weight = 400fontcharset fontcharset = ansi!fontpitch fontpitch = variable!fontfamily fontfamily = swiss!string facename = "Arial"long textcolor = 33554432long backcolor = 67108864string text = "返回值:"boolean focusrectangle = falseend typetype st_returntype from statictext within w_pbcompiler_testinteger x = 9integer y = 476integer width = 297integer height = 60integer textsize = -9integer weight = 400fontcharset fontcharset = ansi!fontpitch fontpitch = variable!fontfamily fontfamily = swiss!string facename = "Arial"long textcolor = 33554432long backcolor = 67108864string text = "返回值類型:"boolean focusrectangle = falseend typetype st_script from statictext within w_pbcompiler_testinteger x = 9integer y = 12integer width = 206integer height = 60integer textsize = -9integer weight = 400fontcharset fontcharset = ansi!fontpitch fontpitch = variable!fontfamily fontfamily = swiss!string facename = "Arial"long textcolor = 33554432long backcolor = 67108864string text = "PB腳本:"boolean focusrectangle = falseend typetype sle_returnvalue from singlelineedit within w_pbcompiler_testinteger x = 334integer y = 608integer width = 1582integer height = 104integer taborder = 30integer textsize = -9integer weight = 400fontcharset fontcharset = ansi!fontpitch fontpitch = variable!fontfamily fontfamily = swiss!string facename = "Arial"long textcolor = 33554432borderstyle borderstyle = stylelowered!end typetype cb_exit from commandbutton within w_pbcompiler_testinteger x = 1664integer y = 856integer width = 242integer height = 104integer taborder = 50integer textsize = -9integer weight = 400fontcharset fontcharset = ansi!fontpitch fontpitch = variable!fontfamily fontfamily = swiss!string facename = "Arial"string text = "退出"end typeevent clicked;close(parent)end eventtype sle_returntype from singlelineedit within w_pbcompiler_testinteger x = 334integer y = 476integer width = 1582integer height = 104integer taborder = 20integer textsize = -9integer weight = 400fontcharset fontcharset = ansi!fontpitch fontpitch = variable!fontfamily fontfamily = swiss!string facename = "Arial"long textcolor = 33554432borderstyle borderstyle = stylelowered!end typetype mle_script from multilineedit within w_pbcompiler_testinteger x = 334integer y = 12integer width = 1582integer height = 432integer taborder = 10integer textsize = -9integer weight = 400fontcharset fontcharset = ansi!fontpitch fontpitch = variable!fontfamily fontfamily = swiss!string facename = "Arial"long textcolor = 33554432boolean vscrollbar = trueboolean autovscroll = trueborderstyle borderstyle = stylelowered!end typetype cb_ok from commandbutton within w_pbcompiler_testinteger x = 1417integer y = 856integer width = 242integer height = 104integer taborder = 40integer textsize = -9integer weight = 400fontcharset fontcharset = ansi!fontpitch fontpitch = variable!fontfamily fontfamily = swiss!string facename = "Arial"string text = "執行"end typeevent clicked;sle_returnvalue.text = f_execpbscript(sle_returntype.text,mle_script.text)end event

相關文章
相關標籤/搜索