Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/22/2021 in all areas

  1. Jos

    au3 in another au3?

    There isn't much I can do about that as this is supposed to be an English forum. I am not warning you... merely explaining why you are getting these "smart remarks. mmm wasting your time? You decided to post here, not me, so please stop the whining and have a little bit more positive approach around here or else you likely won't be getting much support from people. So take a chill pill and try to be more positive and clear on what it is you are asking from us... that is all I ask!
    2 points
  2. Subz

    Windows 11 and the IE udf

    @Chimp Just confirming that both of the scripts you posted worked for me. Windows 11 Enterprise 21H2 (OS Build 22000.176)
    2 points
  3. JockoDundee

    au3 in another au3?

    Actually I was making fun of the answer given. You were asked To which to you responded with $blabla. Now maybe $blabla is a legitimate transaction type in some universe. But in English it bears a truncated resemblance to blah, blah, blah, which often has a negative connotation. So it seemed that you were not only answering the question with snark, but adding insult to injury, you could not be bothered to properly show contempt. Getting back on track, is $blabla still your final answer to the question posed:
    1 point
  4. JockoDundee

    au3 in another au3?

    You can’t even put the effort into typing 3 blahs?
    1 point
  5. Nine

    A problem about DllStruct

    This is a known bug : https://www.autoitscript.com/trac/autoit/ticket/3838
    1 point
  6. Subz

    Windows 11 and the IE udf

    Microsoft intends to support IE mode until 2029 (we use IE mode within Edge Chromium for some legacy software), have AutoIt code that uses a number of IE functions, including IE embedded and everything appears to be working correctly still.
    1 point
  7. Hmm... doesn't seem to be a way with just "send". How about: Sleep(3000) For $i = 1 To 4 Send("test ") Sleep(10) Next ; - or in a function - Func _SendText($text = "test", $n = 4) For $i = 1 To $n Send($text) Sleep(10) Next EndFunc
    1 point
  8. seadoggie01

    AutoIt Snippets

    While I hate this kind of file, I recently had to re-write an Excel VBA script that wrote the worksheet to a fixed width format file. It isn't perfect, but this is what I have so far: ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Export_FixedWidth ; Description ...: Exports an array to a file using a fixed width format ; Syntax ........: _Export_FixedWidth($avData, $aiWidth, $aiPrecision, $sFile[, $sNewLine = Default]) ; Parameters ....: $avData - a 2D array of variants. ; $aiWidth - a 1D array of integers. ; $aiPrecision - a 1D array of integers. Default copies $aiWidth. ; $sFile - full file path to save as or a file handle. ; $sNewLine - [optional] newline. Default is @CRLF. ; Return values .: Success - True ; Failure - False and sets @error: ; |1 - $avData isn't a 2D array ; |2 - $avData has more columns than (@extended) 1 - $aiWidth or 2 - $aiPrecision ; |3 - Unable to write data to $sFile ; Author ........: Seadoggie01 ; Modified ......: December 17, 2020 ; Remarks .......: $aiWidth's and $aiPrecision's sizes must match $avData's column count. ; If $sFile is a handle, it will not be closed ; Data is right aligned; set $aiWidth's value to negative to right align data. ; +$aiPrecision uses the absolute value (helpful if $aiPrecision = $aiWidth) ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Export_FixedWidth($avData, $aiWidth, $aiPrecision, $sFile, $sNewLine = Default) If IsKeyword($aiPrecision) Then $aiPrecision = $aiWidth If IsKeyword($sNewLine) Then $sNewLine = @CRLF ; Ensure 2D array If UBound($avData, 0) <> 2 Then Return SetError(1, 0, False) ; Check sizes of the arrays If UBound($aiWidth) <> UBound($avData, 2) Then Return SetError(2, 1, False) If UBound($aiPrecision) <> UBound($avData, 2) Then Return SetError(2, 2, False) Local $sExportText ; For each row For $iRow = 0 To UBound($avData) - 1 ; For each column For $iColumn = 0 To UBound($avData, 2) - 1 ; Format the data as a string using the width and precision assigned by the user $sExportText &= StringFormat("%" & (-1 * $aiWidth[$iColumn]) & "." & Abs($aiPrecision[$iColumn]) & "s", $avData[$iRow][$iColumn]) Next $sExportText &= $sNewLine Next If Not FileWrite($sFile, $sExportText) Then Return SetError(3, 0, False) Return True EndFunc As the VBA was looping through each cell, reading it (and the precision), and writing it to file, it was taking upwards of 10 minutes as the worksheet was 72 columns x 15367 rows (~1.1 M cells). I'm very impatient and this was just too much. Now it takes less than a second to write the data I lied, I needed more error checking. 🤦‍♂️ However, 24 seconds is still much better
    1 point
×
×
  • Create New...