Editor pairs Posted May 14, 2012 Editor Share Posted May 14, 2012 [code]--###### Fonksiyonumuzu oluşturuyoruz yani VB kodlarımızı yazıyoruz #####--- strVBSCript = [[ Function VBScriptTestFunc(strInput)--VBScriptTestFunc adında bir fonksiyon çağırılan veriyi strInput değişkenine atıyor.Gerisi VB kodlaması strArgs = Split(strInput,"|",-1,1)-- NCount = 1 for each Argument in strArgs msgbox("Argument "& NCount &" : "& Argument) NCount = NCount + 1 next VBScriptTestFunc = "Bu bir Visual Basic Kodlamasıdır." End Function ]] local ScriptControl = luacom.CreateObject("ScriptControl");--LuaCom plugini ile geçen dersimizde anlattığım gibi Excel dosyası yerine VbScript Controller ekliyoruz. if ScriptControl then-- eğer oluşturulduysa ScriptControl:setLanguage("VBScript");--scriptin adını VBScripte Çevir bunu autoit felanda yapılabilir denemedim. ScriptControl:setAllowUI(true); ScriptControl:setSitehWnd(Application.GetWndHandle()); ScriptControl:AddCode(strVBSCript);--Yukarıdaki strVBSCript fonksiyonumuzu çağırıyoruz unutmayın farklı illerin kodlarını ekleyeceğiniz zaman "[[" ve "]]" arasında kullanın. retval = ScriptControl:Run("VBScriptTestFunc","Test Argument 1|Test Argument 2|Test Arguement 3");--Şimdi ise fonksiyonun içindeki VBScriptTestFunc değişkenini çağırdık. Dialog.Message("Notice", retval, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); -- ve sonuç ScriptControl = nil; collectgarbage() end[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.