Jump to content
Sign in to follow this  
Jon

AutoIt v3.3.9.17 Beta

Recommended Posts

guinness

FileReadToArray() is a lot quicker than the UDF version. What a great addition.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
guinness

I don't know if people noticed, but UDF links in the changelog were broken and the developer history was missing. Suffice to say I have fixed this in the next version.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
jchd

<off_topic>

Another hint that guinness and I don't travel at the same speed: time clearly doesn't laps equally for both of us!

</off_topic>


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
czardas

I remember we had some very interesting >discussions about StringReverse. I learned a lot in those discussions.

Perhaps Iwith this I can improve the performance of the surrogate string reverse function (not sure). Thanks Jon.

Edited by czardas

Share this post


Link to post
Share on other sites
guinness

Before _StringReverse() became native, jchd came up with this...

; #FUNCTION# ====================================================================================================================
; Author ........: guinness & jchd
; Modified ......:
; ===============================================================================================================================
Func _StringReverse($sString)
    Local $aSplit = StringRegExp($sString, "\X", 3), _
            $sReturn = ""
    For $i = UBound($aSplit) - 1 To 0 Step -1
        $sReturn &= $aSplit[$i]
    Next
    Return $sReturn
EndFunc   ;==>_StringReverse

X: Match Unicode "eXtended grapheme cluster"


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
czardas

That's neat. :) Such things (clusters) should perhaps be optional because reversing strings is clearly quite different from reversing characters or symbols.

Edited by czardas

Share this post


Link to post
Share on other sites
jchd

Care to explain how exactly things are different?


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
trancexx

Jon see this:

#include <WinAPICom.au3>

;~ Read, Write and Seek methods available
$oStream = StreamFromFile(@ScriptFullPath)


; Struct to read to
$tZip = DllStructCreate("byte[48]")
; Read to that buffer
$oStream.Read($tZip, 48, 0)

ConsoleWrite("!>>> " & DllStructGetData($tZip, 1) & @CRLF)



Func StreamFromFile($sFile)
    Local $hFile = FileOpen($sFile, 16)
    Local $bBinary = FileRead($hFile)
    FileClose($hFile)
    ; Determine the size of binary data
    Local $iSize = BinaryLen($bBinary)
    ; IStream definition
    Local Const $sIID_IStream = "{0000000C-0000-0000-C000-000000000046}"
    ; Define IStream methods:
    Local Const $tagIStream_Small = _
            "Read hresult(struct*;dword;dword*);" & _
            "Write hresult(struct*;dword;dword*);" & _ ; ISequentialStream
            "Seek hresult(int64;dword;uint64*);" ; the rest of IStream methods are omited for brevity (they aren't used here)
    ; Create stream object
    Local $oStream = ObjCreateInterface(_WinAPI_CreateStreamOnHGlobal(), $sIID_IStream, $tagIStream_Small)
    If @error Then Return SetError(1, 0, 0)
    ; Make structure in size of binary data
    Local $tBinary = DllStructCreate("byte[" & $iSize & "]")
    ; Fill it
    DllStructSetData($tBinary, 1, $bBinary)
    ; Set position to start
    Local Const $STREAM_SEEK_SET = 0
    $oStream.Seek(0, $STREAM_SEEK_SET, 0)
    ; Write to the stream
    Local $iWritten
    $oStream.Write($tBinary, $iSize, $iWritten)
    ; Back to start
    $oStream.Seek(0, $STREAM_SEEK_SET, 0)
    ; Return stream object
    Return $oStream
EndFunc

That code should print something like this to console:

!>>> 0x23696E636C756465203C57696E415049436F6D2E6175333E0D0A0D0A3B7E20526561642C20577269746520616E642053

Instead it prints 0 for me. I meant to try it with earliest betas that you did without me to see when exactly this issue appeared but I couldn't find them. I'm pretty sure I dealt with this back then, the comment I left in code was:

// Copy NOT if it's "struct*" type (this is byref on another level).

Do you have that in script_object? $tZip is not struct after the call currently because it gets overwritten.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Jon

Oh I see remember the section of code. I had some nasty regressions with some applications (IE I think) where the byrefs where not working and I had to change it back to this:

// 2013-07-27: Relying on typeinfo caused some problems here http://www.autoitscript.com/trac/autoit/ticket/2367
                    // seemed to be caused by the BSTR check added in revision 6259 that broke it, but this has broken so many times 
                    // in the past in different ways that I'm just checking for the bare minimum.
                    if (funcInfo.bValid)
                    {
                        VARTYPE vParamType = funcInfo.pParamTypes[iParam].vt; // type of current param by interface specification
                        // Copy if [out] flag is set for parameter OR type is of byref kind
                        if ( (funcInfo.pParamTypes[iParam].wParamFlags & PARAMFLAG_FOUT) || (vParamType & VT_BYREF) )
                        {
                            *((*vParams)[iParam].refValue()) = &pArgs[iNumParams-iParam-1];  // Note: COM reference increase!
                        }
                    }
                    else
                    {
                        *((*vParams)[iParam].refValue()) = &pArgs[iNumParams-iParam-1];  // Note: COM reference increase!
                    }

Share this post


Link to post
Share on other sites
trancexx

Then you have broken number of scripts because the code there was result of several bug-fixes if I remember correctly. Beside that, are you sure the cause of your regressions was that?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
trancexx

I just checked bug report 2367 and couldn't figure out what exactly is the bug. Unfortunatly I don't understand languages some people speak.

What is the bug Jon? Did you confirm it using some other language (VBS maybe)?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Jon

No, not sure at all. It was the only change I could find that caused any sort of repo with that bug report. I'm wondering if it's just a coincidence, or maybe the code in that section just makes the underlying issue more likely to be seen (we did a poll with all the MVPs and half could repro and half couldn't. Nightmare). I'll revert the changes for the next beta and reopen the bug.

Share this post


Link to post
Share on other sites
Jon

This was the script we used (slightly more simple than the bug report one).

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt("TrayIconDebug", 1)

Global $ret = 0
; Create two WebBrowser controls to embed
Global $oIE = ObjCreate("Shell.Explorer.2")

; Setup the parent GUI and embed the controls
GUICreate("Embedded Web control Test", 1200, 700, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_CLIPCHILDREN))
GUICtrlCreateObj($oIE, 1, 1, 570, 660)

GUISetState() ;Show GUI

; Update first control
$oIE.navigate("http://www.google.fr")
; Wait for document object to be created
While Not IsObj($oIE.document)
    Sleep(100)
WEnd
; Wait for document load to complete
While $oIE.document.readyState <> "complete"
    Sleep(100)
WEnd

Global $oDocRef1 = $oIE.document
Global $oDocRef2 = $oIE.document

If $oIE.document <> $oIE.document Then $ret = 1 
MsgBox(0, "", $ret)

$ret = 0
If $oDocRef1 <> $oDocRef2 Then $ret = 1 
MsgBox(0, "", $ret)

Share this post


Link to post
Share on other sites
trancexx

You are probably looking at completely different direction than you should.

Check comparison rules for Variants, particularly what happens for VAR_OBJECT rule. If you Ptr() those objects do you get the same values? If yes then it's clear what the problem is and that it's not related to COM code.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×