Jump to content

paulpmeier

Active Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by paulpmeier

  1. Not always, but in some cases, e.g. with "AutoIt Help (v3.3.16.1)". Why? #include <GuiTreeView.au3> Local $hTreeView = ControlGetHandle("AutoIt Help (v3.3.16.1)", "", "SysTreeView321") ;Local $hTreeView = ControlGetHandle("SciTE4AutoIt3", "", "SysTreeView321") ; works correctly Local $hFirstItem = _GUICtrlTreeView_GetFirstItem($hTreeView) ConsoleWrite(_GUICtrlTreeView_GetText($hTreeView, $hFirstItem) & @CRLF)
  2. Hello Jos, in SciTE4AutoIt3_Portable.zip _Array2DCreate is missing in the files ..\SciTE4AutoIt3_Portable\api\au3.api ..\SciTE4AutoIt3_Portable\properties\au3.keywords.properties Paul
  3. Hi AspirinJunkie, Thank you for your Json-Udf. I use it for evaluating my Discogs queries. Attached is a recursive dump script for my maps. #include "Json.au3" #include <String.au3> Local $sJson = FileRead("..\Discogs-Abfragen\The Beatles - Lovely Rita.json") Local $mDiscogsQuery = _JSON_Parse($sJson) Global $iIndent = 0, $sIndent = " " ConsoleWrite("Map $mDiscogsQuery" & @CRLF) _DumpMap($mDiscogsQuery) Func _DumpMap(ByRef $mMap) For $Key In MapKeys($mMap) _WriteElement($Key, $mMap[$Key]) Next EndFunc Func _DumpArray(ByRef $aArray, $Key) For $i = 0 To UBound($aArray) - 1 _WriteElement($Key & "[" & $i & "]", $aArray[$i]) Next EndFunc Func _WriteElement($Key, ByRef $vValue) $iIndent += 1 Local $sInd = _StringRepeat($sIndent, $iIndent) Local $sType = VarGetType($vValue) If $sType = "String" Then $vValue = StringReplace($vValue, @LF, @CRLF & $sInd & $sIndent) ; Indent for multi-line strings If $sType = "Keyword" And IsKeyword($vValue) = 2 Then $vValue = "NULL" ; NULL ConsoleWrite($sInd & $Key & " (" & $sType & "): " & $vValue & @CRLF) If $sType = "Map" Then _DumpMap($vValue) If $sType = "Array" Then _DumpArray($vValue, $Key) $iIndent -= 1 EndFunc Paul
  4. MatzeP, look at the libcurl programming tutorial, Passwords ; protocol://user:[email protected]/path/ Local $aResponse = cURL_easy("http://myusername:[email protected]/logs/") Paul
  5. MatzeP, Copy the files libcrypto-1_1-x64.dll, libssl-1_1-x64.dll and libcurl-x64.dll into your cURL.au3 directory. In cURL.au3 replace in line 125 libcurl.dll with libcurl-x64.dll. Paul
  6. Latest DLLs on https://curl.se/windows/ (09.12.2020) libcurl-x64.dll https://curl.se/windows/dl-7.74.0_2/curl-7.74.0_2-win64-mingw.zip libcrypto-1_1-x64.dll and libssl-1_1-x64.dll https://curl.se/windows/dl-7.74.0_2/openssl-1.1.1i_2-win64-mingw.zip Thank you for this UDF. Paul
  7. Hello pixelsearch, I have added your changes to "ArrayDisplayInternals.au3". The sort context menu is very useful. Thanks again.
  8. Hello pixelsearch, thanks for the detailed explanation. The reference to the functioning of natural sorting explains the behavior of the sort function in _ArrayDisplay. Your "hack" is a great help to me. Thanks a lot. Paul
  9. If I replace 'StrCmpLogicalW' with 'StrCmpCW' in line 613 in ArrayDisplayInternals.au3, the sorting is correct. Pointers and handles can also be sorted this way. But numeric values are then also sorted alphabetically. Paul
  10. Melba, look at this string-array: #include <Array.au3> Global $aSortTest[5][2] = [["1", "01"], ["2", "02"], ["3", "03"], ["A", "0A"], ["B", "0B"]] _ArrayDisplay($aSortTest) The first column is sorted correctly, the second is not. Paul
  11. Example (AutoIt 3.3.14.5): #include <Array.au3> Global $aSortTest[6] = [Ptr(1), Ptr(2), Ptr(3), Ptr(10), Ptr(11), Ptr(12)] _ArrayDisplay($aSortTest) Have I missed something? Paul
  12. For Firefox look also: http://support.mozilla.org/en-US/questions/942316?page=4 tenbucks posted 5/15/13 3:13 AM "Finally. It's here with FF 21. You need to add the browser.shell.shortcutFavicons entry in about:config. It doesn't come with it. Make it boolean and set it to false. Restart FF." Paul
  13. Hallo BugFix, danke für Ihre schöne Funktion, sie macht die Einbindung von .Net-DLLs in AutoIt-Skripte einfacher und eleganter. Ich bin nicht der große .Net-Experte und da im Mai keiner auf diesen Post hier reagierte, habe ich das Thema auch nicht weiterverfolgt. Was den Zugriff auf vorhandene .Net-Klassen angeht, habe ich noch versucht die Ideen von Robert Giseke umzusetzen. Giseke hat ein C# Project Template for Unmanaged Exports geschrieben, mit dem ich eine .Net-DLL erzeugt habe, die auf die DateTime.AddDays-Methode zugreift. http://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexports Anbei meine ungeordneten Experimente incl. Links. Ich hoffe, das hilft Ihnen etwas weiter. Für tiefergehende Informationen müsste ich mich leider erst selbst wieder in die Thematik einarbeiten. Viele Grüße Paul UnmanagedExports.zip
  14. Write a code file in your @ScriptDir like hello.vb Imports System.Collections.Generic Imports System.Text Imports System.Runtime.InteropServices Namespace myDotNetLibrary <ClassInterface(ClassInterfaceType.AutoDual)> _ Public Class myDotNetClass Private myProperty As String Public Sub New() End Sub Public Function myDotNetMethod(input As String) As String Return "Hello " & input End Function Public Property myDotNetProperty() As String Get Return myProperty End Get Set(ByVal value As String) myProperty = value End Set End Property End Class End Namespace and run it from your AutoIt script $vbc = "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\vbc.exe" ; ; check the path of your version $RegAsm = "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" ; check the path of your version RunWait($vbc & " /target:library hello.vb", @ScriptDir, @SW_HIDE) ; compile the .net DLL RunWait($RegAsm & " /codebase hello.dll", @ScriptDir, @SW_HIDE) ; register the .net DLL $obj = ObjCreate("myDotNetLibrary.myDotNetClass") $obj.myDotNetProperty = "AutoIt-World" ConsoleWrite("! " & $obj.myDotNetMethod($obj.myDotNetProperty) & @CRLF) RunWait($RegAsm & " /unregister hello.dll", @ScriptDir, @SW_HIDE) ; unregister the .net DLL dito for C#: multsub.cs using System; using System.Collections.Generic; using System.Runtime.InteropServices; namespace myCSLibrary { [ClassInterface(ClassInterfaceType.AutoDual)] public class MultSubClass { private int myProperty; public MultSubClass() { } public int mult2(int input) { return 2 * input; } public int sub1(int input) { return input - 1; } public int myDotNetProperty { get { return myProperty; } set { myProperty = value; } } } } and the AutoIt script: $csc = "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\csc.exe" ; check the path of your version $RegAsm = "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" ; check the path of your version RunWait($csc & " /target:library multsub.cs", @ScriptDir, @SW_HIDE) ; compile the .net DLL RunWait($RegAsm & " /codebase multsub.dll", @ScriptDir, @SW_HIDE) ; register the .net DLL $obj = ObjCreate("myCSLibrary.MultSubClass") $obj.myDotNetProperty = 3 ConsoleWrite("! " & $obj.sub1($obj.mult2($obj.sub1($obj.mult2($obj.myDotNetProperty)))) & @CRLF) RunWait($RegAsm & " /unregister multsub.dll", @ScriptDir, @SW_HIDE) ; unregister the .net DLL Tested with Windows XP SP3 and .net Framework 3.5/4 Paul DotNetDLLs.zip
  15. A usefull feature of the FileOpen function: FileOpen("Com1", 4) opens the first serial port for binary input. The exsample shows reading NMEA-data from a GPS receiver via Com4. HotKeySet("{ESC}", "Terminate") $file = FileOpen("COM4", 4) While 1 $chr = FileRead($file, 1) ConsoleWrite($chr) WEnd Func Terminate() FileClose($file) Exit EndFunc See also: Console Input - Read from console with FileRead
  16. Hello ResNullius, In DBase number of records are stored least significant byte first (Little-Endian). Data File Header Structure Endianness You must first convert the Binary value to Int. And than convert Little-Endian to Big-Endian. $dbf = FileOpen("test.dbf", 16) $4Bytes = BinaryMid(FileRead($dbf, 8), 5);capture the 4 bytes (5-8) we're interested in ConsoleWrite($4Bytes & @CRLF) ; Binary to Int conversion $4BytesInt = Dec(Hex($4Bytes)) ConsoleWrite($4BytesInt & ", Type: " & VarGetType($4BytesInt) & @CRLF) ; Little-Endian to Big-Endian conversion $num = BitShift(BitAND($4BytesInt, 0x000000FF), -24) + BitShift(BitAND($4BytesInt, 0x0000FF00), -8) + _ BitShift(BitAND($4BytesInt, 0x00FF0000), +8) + BitShift(BitAND($4BytesInt, 0xFF000000), +24) MsgBox(0, "Number of Records", $num) Paul
  17. Hello ResNullius, try this: $dbf = FileOpen("test.dbf", 16) $4Bytes = BinaryMid(FileRead($dbf, 8), 5);capture the 4 bytes (5-8) we're interested in ConsoleWrite($4Bytes & @CRLF) $num = AscW(BinaryToString(BinaryMid($4Bytes, 1, 2), 2)) + _ AscW(BinaryToString(BinaryMid($4Bytes, 3, 2), 2)) * 0x10000 MsgBox(0, "Number of Records", $num) Paul
  18. Hello ResNullius I remembered a similar old Microsoft Basic statement. So I tried it with the AutoIt FileRead function. And it works. Paul
  19. A usefull feature of the FileOpen function: FileOpen("con", 4) opens console for binary input. #AutoIt3Wrapper_Change2CUI=y $input = "" ConsoleWrite(@CRLF & "Write some text and close with ENTER: ") $file = FileOpen("con", 4) While 1 $chr = FileRead($file, 1) If $chr = @LF Then ExitLoop $input = $input & BinaryToString($chr) WEnd FileClose($file) ConsoleWrite(@CRLF & "Input was: " & $input & @CRLF) To read lines instead of single characters use this code: #AutoIt3Wrapper_Change2CUI=y $maxchr = 123 $input = "" ConsoleWrite(@CRLF & "Write some text and close with ENTER: ") $file = FileOpen("con", 4) $line = BinaryToString(FileRead($file, $maxchr)) FileClose($file) ConsoleWrite(@CRLF & "Your input was: " & $line & @CRLF) Compile as CUI and start the exe-file from console prompt. (Tested with AutoIt 3.2.12.1 and Windows XP SP2) Paul See also: Reading from serial ports with FileRead
  20. Very usefull. Thank you. Please add in the code #include <WindowsConstants.au3> for new AutoIt versions. Paul
  21. Hi rasim! I have tested your script in a VMware Workstation virtual machine (Windows XP Pro). Yes, it works fine. Paul
×
×
  • Create New...