Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/15/2020 in all areas

  1. Thanks for the reminder! Here you are (just baked, bugs lurking): ; returns the result of a select query as JSON string; @extended is row count Func _SQLite_GetTableJSON($hDB, $sSQL) If __SQLite_hChk($hDB, 1) Then Return SetError(@error, 0, $SQLITE_MISUSE) Local $hQuery Local $r = _SQLite_Query($hDB, $sSQL, $hQuery) If @error Then Return SetError(2, @error, $r) If $r <> $SQLITE_OK Then __SQLite_ReportError($hDB, "_SQLite_GetTableJSON", $sSQL) _SQLite_QueryFinalize($hQuery) Return SetError(-1, 0, $r) EndIf Local $aDataNames $r = _SQLite_FetchNames($hQuery, $aDataNames) If @error Then $iError = @error _SQLite_QueryFinalize($hQuery) Return SetError(5, $iError, $r) EndIf $iColumns = UBound($aDataNames) If $iColumns <= 0 Then _SQLite_QueryFinalize($hQuery) Return SetError(-1, 0, $SQLITE_DONE) Else For $i = 0 To $iColumns - 1 $aDataNames[$i] = _StringToJson($aDataNames[$i]) Next EndIf Local $iRval_Step, $iError, $iRval_coltype, $sResult = '{"result":[', $Rval, $iRows While True $iRval_Step = DllCall($__g_hDll_SQLite, "int:cdecl", "sqlite3_step", "ptr", $hQuery) If @error Then $iError = @error _SQLite_QueryFinalize($hQuery) $sResult = "" Return SetError(3, $iError, $SQLITE_MISUSE) ; DllCall error EndIf Switch $iRval_Step[0] Case $SQLITE_ROW $iRows += 1 $sResult &= "{" For $i = 0 To $iColumns - 1 $iRval_coltype = DllCall($__g_hDll_SQLite, "int:cdecl", "sqlite3_column_type", "ptr", $hQuery, "int", $i) If @error Then Return SetError(4, @error, $SQLITE_MISUSE) ; DllCall error $sResult &= $aDataNames[$i] & ':' Switch $iRval_coltype[0] Case $SQLITE_TYPE_INTEGER $Rval = DllCall($__g_hDll_SQLite, "int64:cdecl", "sqlite3_column_int64", "ptr", $hQuery, "int", $i) If @error Then Return SetError(3, @error, $SQLITE_MISUSE) ; DllCall error $sResult &= $Rval[0] Case $SQLITE_TYPE_TEXT $Rval = DllCall($__g_hDll_SQLite, "wstr:cdecl", "sqlite3_column_text16", "ptr", $hQuery, "int", $i) If @error Then Return SetError(3, @error, $SQLITE_MISUSE) ; DllCall error $sResult &= _StringToJson($Rval[0]) Case $SQLITE_TYPE_FLOAT $Rval = DllCall($__g_hDll_SQLite, "double:cdecl", "sqlite3_column_double", "ptr", $hQuery, "int", $i) If @error Then Return SetError(3, @error, $SQLITE_MISUSE) ; DllCall error $sResult &= $Rval[0] Case $SQLITE_TYPE_NULL $sResult &= "null" Case Else ; Blob or unknown datatype at date of writing: output hex as "0x0123456789ABCDEF..." Local $vResult = DllCall($__g_hDll_SQLite, "ptr:cdecl", "sqlite3_column_blob", "ptr", $hQuery, "int", $i) If @error Then Return SetError(6, @error, $SQLITE_MISUSE) ; DllCall error Local $iColBytes = DllCall($__g_hDll_SQLite, "int:cdecl", "sqlite3_column_bytes", "ptr", $hQuery, "int", $i) If @error Then Return SetError(5, @error, $SQLITE_MISUSE) ; DllCall error Local $tResultStruct = DllStructCreate("byte[" & $iColBytes[0] & "]", $vResult[0]) $sResult &= '"' & Binary(DllStructGetData($tResultStruct, 1)) & '"' EndSwitch If $i < $iColumns - 1 Then $sResult &= "," Next $sResult &= "}," Case $SQLITE_DONE If $iRows Then $sResult = StringTrimRight($sResult, 1) $sResult &= "]}" ExitLoop Case Else _SQLite_QueryFinalize($hQuery) Return SetError(3, $iError, $iRval_Step[0]) EndSwitch WEnd _SQLite_QueryFinalize($hQuery) Return SetError(0, $iRows, $sResult) EndFunc ;==>_SQLite_GetTableJSON ; escape characters in strings w.r.t all relevant RFCs. Check https://jsonformatter.curiousconcept.com/ Func _StringToJson($s) $s = StringRegExpReplace($s, '([\\/])', '\\$1') ; escape \ and / first $s = StringReplace($s, '"', '\""') ; escape " $s = StringReplace($s, Chr(0x08), '\b') ; escape backspace $s = StringReplace($s, Chr(0x0C), '\f') ; escape formfeed $s = StringReplace($s, @TAB, '\t') ; escape @TAB $s = StringReplace($s, @LF, '\n') ; escape @LF $s = StringReplace($s, @CR, '\r') ; escape @CR $s = Execute('"' & StringRegExpReplace($s, '([\x00-\x1F\x7F-\x9F])', '" & "\\u" & Hex(AscW("$1"), 4) & "') & '"') ; escape other ctrl chars Return '"' & $s & '"' EndFunc ;==>_StringToJson Example use (cw is an advanced consolewrite for UTF8 and more): #include <SQLite.au3> Const $SQLITE_DLL = "C:\SQLite\bin\sqlite3.dll" ;<-- Change to the location of your sqlite dll ;~ Const $SQLITE_DLL = "C:\SQLite\bin\system.data.sqlite.dll" ;<-- Change to the location of your sqlite dll ; Init sqlite _SQLite_Startup($SQLITE_DLL, False, 1) If @error Then Exit MsgBox($MB_ICONERROR, "SQLite Error", "Unable to start SQLite. Check existence of DLL") ConsoleWrite("SQlite version " & _SQLite_LibVersion() & @LF & @LF) Local $hDB = _SQLite_Open() Local $sOut _SQLite_Exec($hDB, "create table T (Id integer primary key, FirstName text, LastName text, Birth text, Death text)") _SQLite_Exec($hDB, "insert into T values (10, 'Bohr', 'Niels', '1885/10/07', '1962/11/18')") _SQLite_Exec($hDB, "insert into T values (11, 'Fermi', 'Enrico', '1901/09/29', '1954/11/28')") _SQLite_Exec($hDB, "insert into T values (15, 'Albert', 'Einstein', '1879/03/14', '1955/04/18')") _SQLite_Exec($hDB, "insert into T values (19, 'Rovelli', 'Carlo', '1956/05/03', null)") _SQLite_Exec($hDB, "insert into T values (7, 'Schrödinger', 'Erwin', '1887/08/12', '1961/01/04')") _SQLite_Exec($hDB, "insert into T values (39, 'Higgs', 'Peter', '1929/05/29', null)") $sOut = _SQLite_GetTableJSON($hDB, "SELECT * from T") cw(@extended & " row" & (@extended ? "s" : "")) cw($sOut & @LF) $sOut = _SQLite_GetTableJSON($hDB, "SELECT +555555555555555 col_int, null col_null, '' col_str0, 3.1415926 col_float, -0.00031415926e117 col_floatexp, cast('xyz' as blob) col_blob, 'Árvíztűrőñ tükörfúrógépçô ŵƂǚȨǽϋϔӪӢӂ' col_str") cw(@extended & " row" & (@extended ? "s" : "")) cw($sOut & @LF) $sOut = _SQLite_GetTableJSON($hDB, "SELECT 'abc\" & Chr(0x0B) & "def'") cw(@extended & " row" & (@extended ? "s" : "")) cw($sOut & @LF) $sOut = _SQLite_GetTableJSON($hDB, "SELECT null, 0, 'aa""bb' [abc" & @TAB & "def]") cw(@extended & " row" & (@extended ? "s" : "")) cw($sOut & @LF) $sOut = _SQLite_GetTableJSON($hDB, "SELECT * from T where id = 0") cw(@extended & " row" & (@extended ? "s" : "")) cw($sOut) _SQLite_Close($hDB) _SQLite_Shutdown() Giving: SQlite version 3.32.3 6 rows {"result":[{"Id":7,"FirstName":"Schrödinger","LastName":"Erwin","Birth":"1887\/08\/12","Death":"1961\/01\/04"},{"Id":10,"FirstName":"Bohr","LastName":"Niels","Birth":"1885\/10\/07","Death":"1962\/11\/18"},{"Id":11,"FirstName":"Fermi","LastName":"Enrico","Birth":"1901\/09\/29","Death":"1954\/11\/28"},{"Id":15,"FirstName":"Albert","LastName":"Einstein","Birth":"1879\/03\/14","Death":"1955\/04\/18"},{"Id":19,"FirstName":"Rovelli","LastName":"Carlo","Birth":"1956\/05\/03","Death":null},{"Id":39,"FirstName":"Higgs","LastName":"Peter","Birth":"1929\/05\/29","Death":null}]} 1 rows {"result":[{"col_int":555555555555555,"col_null":null,"col_str0":"","col_float":3.1415926,"col_floatexp":-3.1415926e+113,"col_blob":"0x78797A","col_str":"Árvíztűrőñ tükörfúrógépçô ŵƂǚȨǽϋϔӪӢӂ"}]} 1 rows {"result":[{"'abc\\\u000Bdef'":"abc\\\u000Bdef"}]} 1 rows {"result":[{"null":null,"0":0,"abc\tdef":"aa\"bb"}]} 0 row {"result":[]} JSON doesn't support binary values; if fetched from a table, they are output as strings, e.g. "0x0123456789ABCDEF..." OTOH, SQLite has no boolean datatype, so json true and false are never used.
    2 points
  2. It's obviously the most handy and versatile way. Most multilingual softwares have English language hardcoded and provide external language files. This way allows easy corrections, further language additions etc
    2 points
  3. My personal preference is to go with a database. It allows me to quickly get all labels, messages, errors, lists, etc. What I usually do is to assign an ID to each pages of a GUI so I query in an array all the texts with a single call. It is also extremely easy to add or remove a language. I never hardcode a language, because if the client wants to modify a certain term, you do not need to provide a new set of exe, he can make his own modification without involving you.
    1 point
  4. Jos

    ISN AutoIt Studio

    Did you see the rest of that post?
    1 point
  5. I don't think there is any rule against crypto-mining, and why would there one be anyway? The user is using their own computer to perform mathematical calculations, nothing wrong with that
    1 point
  6. Looks like they've done some changes to the Calculator class name. This works: #include <Constants.au3> ; ; AutoIt Version: 3.0 ; Language: English ; Platform: Win9x/NT ; Author: Jonathan Bennett (jon at autoitscript dot com) ; ; Script Function: ; Plays with the calculator. ; ; Prompt the user to run the script - use a Yes/No prompt with the flag parameter set at 4 (see the help file for more details) Local $iAnswer = MsgBox(BitOR($MB_YESNO, $MB_SYSTEMMODAL), "AutoIt Example", "This script will run the calculator and type in 2 x 4 x 8 x 16 and then quit. Do you want to run it?") ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script If $iAnswer = 7 Then MsgBox($MB_SYSTEMMODAL, "AutoIt", "OK. Bye!") Exit EndIf ; Run the calculator Run("calc.exe") ; Wait for the calculator to become active. The classname "CalcFrame" is monitored instead of the window title Local $returnValue = WinWaitActive("Calculator", "", 2) ; Now that the calculator window is active type the values 2 x 4 x 8 x 16 ; Use AutoItSetOption to slow down the typing speed so we can see it if($returnValue <> 0) Then AutoItSetOption("SendKeyDelay", 400) Send("2*4*8*16=", 1) Sleep(2000) Else ConsoleWrite("Start timed out") EndIf ; Now quit by sending a "close" request to the calculator window using the classname WinClose("Calculator") ; Now wait for the calculator to close before continuing WinWaitClose("Calculator") ; Finished!
    1 point
  7. I'm mainly using two scripting languages: AutoIt and Perl. Today I'm mostly using AutoIt. In the past mostly Perl. I've long had an idea of integrating AutoIt and Perl to be able to generate and collect data in Perl scripts and display data in AutoIt GUIs. Over the past few months, I've been working on examples about ROT objects and their use in IPC techniques. I've tested the ideas with regard to AutoIt/Perl integration. It seems to work. Install PerlTo use the Perl programming language on a Windows PC, the program must be installed. I'm using ActivePerl from ActiveState. An alternative distribution is Strawberry Perl. ActivePerl seems to be the easiest to use. Strawberry Perl is more advanced and includes a complete C/C++ compiler. The interesting Perl module for AutoIt/Perl integration is the Win32::OLE module. It's the module that makes Perl a COM compatible programming language. Remember to add this module to your Perl installation. PerlScript Be careful not to confuse Perl with PerlScript. PerlScript is a Perl module developed by ActiveState and is only a small part of the ActivePerl package for Windows. PerlScript is an ActiveX Scripting Engine for the Perl language to use Perl to create dynamic content on the Microsoft web server (in the same way as it can be done with VBScript and JScript). First attemptServer.au3 (Examples\0) First attempt\): #include <GUIConstantsEx.au3> #include "..\..\Includes\IRunningObjectTable.au3" Example() Func Example() Local $hGui = GUICreate( "AutoIt/Perl integration", 300, 100 ) Local $sText = "Run Client.pl:" & @CRLF & _ "Open a Command Prompt in current folder." & @CRLF & _ "Key in ""Perl Client.pl"" and hit the Enter key." & @CRLF & _ "Or ""Perl Client.pl >Client.txt"" to get output in file." GUICtrlCreateLabel( $sText, 20, 20, 260, 60 ) GUISetState( @SW_SHOW, $hGui ) Local $sDataTransfer = "DataTransfer" ROT_RegisterObject( Default, $sDataTransfer ) ; Default => Object = Dictionary object While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete( $hGui ) EndFunc In the first attempt, we'll simply test whether the GetObject() function in a Perl script is at all able to recognize the ROT object (the dictionary object), and thus return something similar to a dictionary object. This is more or less the same as we did in the VBScript example in the bottom half of this post. So far, no data is stored in the ROT object. This Perl snippet copied from Win32::OLE can be used to test whether the ROT object is recognized. The code snippet prints object and class information: Win32::OLE->EnumAllObjects( sub { my $Object = shift; my $Class = Win32::OLE->QueryObjectType( $Object ); printf "Object = %s, Class = %s\n", $Object, $Class; } ); Client.pl: use strict; use Win32::OLE; my $oObj = Win32::OLE->GetObject( "DataTransfer" ); Win32::OLE->EnumAllObjects( sub { my $Object = shift; my $Class = Win32::OLE->QueryObjectType( $Object ); printf "Object = %s, Class = %s\n", $Object, $Class; } ); Output: Object = Win32::OLE=HASH(0x71b5a8), Class = IDictionary It looks good. The ROT object is recognized as a kind of HASH object (sometimes called associative array, dictionary or map) of class IDictionary. This corresponds to the fact that the ROT object is actually a dictionary object. Data from AutoIt to PerlSimple dataNow we can store simple data in the ROT object this way. Server.au3 (Examples\1) AutoIt to Perl\1) Simple data\): Local $oDataTransfer = ObjGet( $sDataTransfer ) ; Dictionary object $oDataTransfer( "$iInt" ) = 123 $oDataTransfer( "$fFlt" ) = 123.456 $oDataTransfer( "$sStr" ) = "String" Client.pl: use strict; use Win32::OLE; my $oObj = Win32::OLE->GetObject( "DataTransfer" ); print "$oObj->{'$iInt'}\n"; print "$oObj->{'$fFlt'}\n"; print "$oObj->{'$sStr'}\n"; Output: 123 123.456 String 1D arrayServer.au3 (Examples\1) AutoIt to Perl\2) 1D array\): Local $oDataTransfer = ObjGet( $sDataTransfer ) ; Dictionary object Local $aArray = [ 123, 123.456, "String" ] $oDataTransfer( "$aArray" ) = $aArray Client.pl: use strict; use Win32::OLE; my $oObj = Win32::OLE->GetObject( "DataTransfer" ); print "@{$oObj->{'$aArray'}}\n"; Output: 123 123.456 String Note that internal data types of array elements are preserved. 2D arrayServer.au3 (Examples\1) AutoIt to Perl\2) 2D array\): Local $oDataTransfer = ObjGet( $sDataTransfer ) ; Dictionary object Local $aArray[1000][10] For $i = 0 To 1000 - 1 For $j = 0 To 10 - 1 $aArray[$i][$j] = $i & "/" & $j Next Next $oDataTransfer( "$aArray" ) = $aArray Client.pl: use strict; use Win32::OLE; my $oObj = Win32::OLE->GetObject( "DataTransfer" ); foreach my $aRow ( @{$oObj->{'$aArray'}} ) { print "@{$aRow}\n"; } Output: 0/0 1/0 2/0 3/0 4/0 5/0 6/0 7/0 8/0 9/0 10/0 11/0 12/0 13/0 14/0 15/0 ... 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 10/1 11/1 12/1 13/1 14/1 15/1 ... 0/2 1/2 2/2 3/2 4/2 5/2 6/2 7/2 8/2 9/2 10/2 11/2 12/2 13/2 14/2 15/2 ... 0/3 1/3 2/3 3/3 4/3 5/3 6/3 7/3 8/3 9/3 10/3 11/3 12/3 13/3 14/3 15/3 ... 0/4 1/4 2/4 3/4 4/4 5/4 6/4 7/4 8/4 9/4 10/4 11/4 12/4 13/4 14/4 15/4 ... 0/5 1/5 2/5 3/5 4/5 5/5 6/5 7/5 8/5 9/5 10/5 11/5 12/5 13/5 14/5 15/5 ... 0/6 1/6 2/6 3/6 4/6 5/6 6/6 7/6 8/6 9/6 10/6 11/6 12/6 13/6 14/6 15/6 ... 0/7 1/7 2/7 3/7 4/7 5/7 6/7 7/7 8/7 9/7 10/7 11/7 12/7 13/7 14/7 15/7 ... 0/8 1/8 2/8 3/8 4/8 5/8 6/8 7/8 8/8 9/8 10/8 11/8 12/8 13/8 14/8 15/8 ... 0/9 1/9 2/9 3/9 4/9 5/9 6/9 7/9 8/9 9/9 10/9 11/9 12/9 13/9 14/9 15/9 ... Rows and columns are swapped in the Perl array. Dict objServer.au3 (Examples\1) AutoIt to Perl\4) Dict obj\): Local $oDataTransfer = ObjGet( $sDataTransfer ) ; Dictionary object Local $oDict = ObjCreate( "Scripting.Dictionary" ) $oDict( "$iInt" ) = 123 $oDict( "$fFlt" ) = 123.456 $oDict( "$sStr" ) = "String" $oDataTransfer( "$oDict" ) = $oDict Client.pl: use strict; use Win32::OLE; my $oObj = Win32::OLE->GetObject( "DataTransfer" ); print "${$oObj->{'$oDict'}}{'$iInt'}\n"; print "${$oObj->{'$oDict'}}{'$fFlt'}\n"; print "${$oObj->{'$oDict'}}{'$sStr'}\n"; Output: 123 123.456 String Data from Perl to AutoItSimple dataServer.au3 (Examples\2) Perl to AutoIt\1) Simple data\): #include "..\..\..\Includes\IRunningObjectTable.au3" Example() Func Example() Local $sDataTransfer = "DataTransfer" ROT_RegisterObject( Default, $sDataTransfer ) ; Default => Object = Dictionary object RunWait( @ComSpec & " /c " & "Perl Client.pl", "", @SW_HIDE ) Local $oDataTransfer = ObjGet( $sDataTransfer ) ; Dictionary object MsgBox( 0, "AutoIt/Perl integration", "$oDataTransfer( ""$iInt"" ) = " & $oDataTransfer( "$iInt" ) & @CRLF & _ "$oDataTransfer( ""$fFlt"" ) = " & $oDataTransfer( "$fFlt" ) & @CRLF & _ "$oDataTransfer( ""$sStr"" ) = " & $oDataTransfer( "$sStr" ) ) EndFunc Client.pl: use strict; use Win32::OLE; my $oObj = Win32::OLE->GetObject( "DataTransfer" ); $oObj->{'$iInt'} = 123; $oObj->{'$fFlt'} = 123.456; $oObj->{'$sStr'} = "String"; Output: $oDataTransfer( "$iInt" ) = 123 $oDataTransfer( "$fFlt" ) = 123.456 $oDataTransfer( "$sStr" ) = String 1D arrayServer.au3 (Examples\2) Perl to AutoIt\2) 1D array\): #include "..\..\..\Includes\IRunningObjectTable.au3" #include <Array.au3> Example() Func Example() Local $sDataTransfer = "DataTransfer" ROT_RegisterObject( Default, $sDataTransfer ) ; Default => Object = Dictionary object RunWait( @ComSpec & " /c " & "Perl Client.pl", "", @SW_HIDE ) Local $oDataTransfer = ObjGet( $sDataTransfer ) ; Dictionary object Local $aArray = $oDataTransfer( "$aArray" ) _ArrayDisplay( $aArray ) EndFunc Client.pl: use strict; use Win32::OLE; my $oObj = Win32::OLE->GetObject( "DataTransfer" ); my @aArray = ( 123, 123.456, "String" ); $oObj->{'$aArray'} = \@aArray; Output: 123 123.456 String 2D arrayServer.au3 (Examples\2) Perl to AutoIt\3) 2D array\): #include "..\..\..\Includes\IRunningObjectTable.au3" #include <Array.au3> Example() Func Example() Local $sDataTransfer = "DataTransfer" ROT_RegisterObject( Default, $sDataTransfer ) ; Default => Object = Dictionary object RunWait( @ComSpec & " /c " & "Perl Client.pl", "", @SW_HIDE ) Local $oDataTransfer = ObjGet( $sDataTransfer ) ; Dictionary object Local $aArray = $oDataTransfer( "$aArray" ) _ArrayDisplay( $aArray ) EndFunc Client.pl: use strict; use Win32::OLE; my $oObj = Win32::OLE->GetObject( "DataTransfer" ); my @aArray; for( my $i = 0; $i < 10; $i++ ) { for( my $j = 0; $j < 1000; $j++ ) { $aArray[$i][$j] = $j . "/" . $i; } } $oObj->{'$aArray'} = \@aArray; Output: 0/0 0/1 0/2 0/3 0/4 0/5 0/6 0/7 0/8 0/9 1/0 1/1 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 2/0 2/1 2/2 2/3 2/4 2/5 2/6 2/7 2/8 2/9 3/0 3/1 3/2 3/3 3/4 3/5 3/6 3/7 3/8 3/9 4/0 4/1 4/2 4/3 4/4 4/5 4/6 4/7 4/8 4/9 5/0 5/1 5/2 5/3 5/4 5/5 5/6 5/7 5/8 5/9 6/0 6/1 6/2 6/3 6/4 6/5 6/6 6/7 6/8 6/9 7/0 7/1 7/2 7/3 7/4 7/5 7/6 7/7 7/8 7/9 8/0 8/1 8/2 8/3 8/4 8/5 8/6 8/7 8/8 8/9 9/0 9/1 9/2 9/3 9/4 9/5 9/6 9/7 9/8 9/9 10/0 10/1 10/2 10/3 10/4 10/5 10/6 10/7 10/8 10/9 11/0 11/1 11/2 11/3 11/4 11/5 11/6 11/7 11/8 11/9 12/0 12/1 12/2 12/3 12/4 12/5 12/6 12/7 12/8 12/9 13/0 13/1 13/2 13/3 13/4 13/5 13/6 13/7 13/8 13/9 14/0 14/1 14/2 14/3 14/4 14/5 14/6 14/7 14/8 14/9 15/0 15/1 15/2 15/3 15/4 15/5 15/6 15/7 15/8 15/9 ... Dict objServer.au3 (Examples\2) Perl to AutoIt\4) Dict obj\): #include "..\..\..\Includes\IRunningObjectTable.au3" #include <Array.au3> Example() Func Example() Local $sDataTransfer = "DataTransfer" ROT_RegisterObject( Default, $sDataTransfer ) ; Default => Object = Dictionary object RunWait( @ComSpec & " /c " & "Perl Client.pl", "", @SW_HIDE ) Local $oDataTransfer = ObjGet( $sDataTransfer ) ; Dictionary object Local $aDict = $oDataTransfer( "$aDict" ) _ArrayDisplay( $aDict ) EndFunc Client.pl: use strict; use Win32::OLE; my $oObj = Win32::OLE->GetObject( "DataTransfer" ); my %oDict = ( '$iInt' => 123, '$fFlt' => 123.456, '$sStr' => "String" ); my @aDict = ( [ keys %oDict ], [ values %oDict ] ); $oObj->{'$aDict'} = \@aDict; Output: $iInt 123 $fFlt 123.456 $sStr String 7z-fileThe 7z-file contains source code for the UDF and examples. You need AutoIt 3.3.12 or later. Tested on Windows 7 and Windows 10. Comments are welcome. Let me know if there are any issues. AutoItAndPerl.7z
    1 point
×
×
  • Create New...