Jump to content

Ams Ile Visual Basic Kodlarının Kullanımı


pairs
 Share

Recommended Posts

  • Editor
[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]
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...