lattey Posted June 12, 2017 Share Posted June 12, 2017 (edited) i have a vbscript that called an autoit exe file and autoit exe file will return value to vbscript. vbscriptto call the exe and create array: Set objShell = CreateObject("WScript.Shell") objShell.Run ( "C:\Datalog\test.exe") Dim intCtr: intCtr=-1 Dim tempArr() Set UID = CreateObject("System.Collections.ArrayList") CurLot = "" For Each filelog in FileList LogFile = Split(filelog, "~")(1) Set otf = fso.OpenTextFile("C:\Datalog\" & LogFile, 1) intCtr=intCtr+1 sFile = Split(LogFile, "_") CurStep = sFile(4) Redim preserve tempArr(intCtr) tempArr(intCtr)=CurStep next autoit: expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <ButtonConstants.au3> #include <Array.au3> Global $Count = 10 Global $CheckBox[$Count] global $array1[1] $hGUI = GUICreate("Test", 500, 500) Global $array_Pstep[10] = ["P1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10"] $Spacing = 24 For $i = 0 To UBound($array_Pstep) - 1 $CheckBox[$i] = GUICtrlCreateCheckbox($array_Pstep[$i], 80, $Spacing + (20 * $i), 65, 17) Next $submit = GUICtrlCreateButton("submit",10, 300, 80, 30) GUISetState() While 1 $Msg = GUIGetMsg() Switch $Msg case $submit _ArrayDisplay($array1) Case Else For $i = 0 To $Count - 1 If $CheckBox[$i] = $Msg Then MsgBox("", "Pressed", $i) _ArrayAdd($array1, $array_Pstep[$i]) ExitLoop EndIf Next EndSwitch WEnd i need to compare the array in vbscript and array return by autoit. but i dont know how to pass the value of array in autoit to vbscript. Please help. Edited June 12, 2017 by lattey Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 12, 2017 Moderators Share Posted June 12, 2017 Just out of curiosity, why are you guaranteeing yourself a headache by mixing and matching two very similar-syntax languages, rather than simply converting the vbscript to AutoIt and skipping the middle man? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
lattey Posted June 13, 2017 Author Share Posted June 13, 2017 the original script is in vbscript and i just need to add the comparing array feature with checked box. Since vbscript must used the hta, i prefer to used autoit. besides, the vbscript have dependency with other vbscript. Link to comment Share on other sites More sharing options...
junkew Posted June 13, 2017 Share Posted June 13, 2017 Write in AutoIt exe to stdout and in vbscript with createobject filesystemobject read from stdin that should be quick and easy. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
lattey Posted June 14, 2017 Author Share Posted June 14, 2017 hi junkew, can you please give me sample of how to do it? Link to comment Share on other sites More sharing options...
LarsJ Posted June 14, 2017 Share Posted June 14, 2017 Here's all you need: junkew 1 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
junkew Posted June 14, 2017 Share Posted June 14, 2017 @LarsJso many beatifull scripts in the forums. Brilliant @trancexx to add things on the fly to ROT. Will try to understand if it can be mixed into CLR.AU3. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now