
Basement
Members-
Posts
19 -
Joined
-
Last visited
Basement's Achievements

Seeker (1/7)
0
Reputation
-
Basement reacted to a post in a topic: ie.au3 --> how long will it be supported by windows - (Moved)
-
Hi, i want to use the following code for i project but wonder, if it will work in future versions of windows as internet explorer is discontinued (because of edge): #include <GUIConstants.au3> ;Makes the gui possible #Include <ie.au3> ;Makes browsing the internet possible Global $ini = @ScriptDir & "\swb.ini" ;INI To Store Last WEBSITE Visited $Form1 = GUICreate("Simple Web Browser MINI Version", 628, 436, 193, 115) ;Creates the GUI $Obj1 = ObjCreate("Shell.Explorer.2") ;Creates the Internet Explorer Object $Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 0, 626, 412) ;Set Object on the GUI $Button1 = GUICtrlCreateButton("URL", 0, 416, 627, 17, 0) ;Makes the Browse URL Button GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") ;Sets the Font of the Button5 $iniread = iniread($ini, "URL", "LAST URL", "");Reads the ini so it can navigate to the last URL If $iniread = "" Then ;If the ini doesnt have a previous saved url then write the default as google.com iniwrite($ini, "URL", "LAST URL", "www.google.com") ;Writes google into the homepage endif $iniread1 = iniread($ini, "URL", "LAST URL", "");Reads the ini so it can navigate to the last URL _IENavigate($Obj1, ""&$iniread1&"") ;Before the GUI is shown, browse to google. Sorta like a homepage GUISetState(@SW_SHOW) ;Shows the GUI While 1 ;Creates a loop to capture the GUI Messages like close and the url button $update = _IEPropertyGet($Obj1, "locationurl") ;Gets the URL from internet explorer IniWrite($ini, "URL", "LAST URL", $update) ;Writes the URL to the ini to navigate on startup $nMsg = GUIGetMsg() ;Gets the Message Switch $nMsg Case $GUI_EVENT_CLOSE ;If you pressed the close button Exit ;It will exit Case $Button1 ;If you pressed the URL Button $URL = InputBox("SWBmini", "Type in the url you wish to go to:") ;Asks what url you want to go to _IENavigate($Obj1, $URL) ;Navigate to the URL. This is what requires the IE.au3 at the top EndSwitch WEnd ;This ends the loop Will this stop working in the next windows release? If yes: Is there a way to get something similar with edge or firefox? I just want a browser in a separate, small window (not in the browser itself). Best wishes Daniel
-
_Excel_RangeWrite with line break
Basement replied to Basement's topic in AutoIt General Help and Support
Thanx!!! This works perfectly for me. You made my day ;-) Best wishes Daniel -
_Excel_RangeWrite with line break
Basement replied to Basement's topic in AutoIt General Help and Support
Hi. i have tried your example with the following 4 versions: Version 1: Line 1 & @CRLF & Line 2 Version 2: "Line 1" & @CRLF & "Line 2" Version 3: Line 1' & @CRLF & 'Line 2' Version 4: "Line 1 & @CRLF & Line 2" Version 1 and 3 result in an empty string ;-( Here's my code: #include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> #include <File.au3> ; Create application object and create a new workbook Local $oAppl = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookNew($oAppl) If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example", "Error creating the new workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oAppl) Exit EndIf ; ***************************************************************************** ; Write a 1D array to the active sheet in the active workbook ; ***************************************************************************** Local $aArray _FileReadToArray("Test.csv", $aArray); _ArrayDisplay($aArray); For $y=1 to UBound($aArray)-1 Step +1 MsgBox(0, "Line prior to conversion", $aArray[$y]) $sRealString= Execute($aArray[$y]) MsgBox(0, "Line after conversion", $sRealString) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $sRealString, "A"&$y) Next If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example 2", "Error writing to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example 2", "1D array successfully written.") Seems that i'm too blind to find the solution this day...maybe tommorrow will be better ;-) -
_Excel_RangeWrite with line break
Basement replied to Basement's topic in AutoIt General Help and Support
Hi, sorry, i asked to quick ;-) When i use @CRLF in my previous example the line break works fine. But my Array-Input comes from a csv file. In the CSV-File i want to define the line breaks. After reading it to an array (and processing it) the line breaks in the output Excel file should be overtaken. But this is what i get (Test.csv=Input file, Mappe8.csv= output file) Now unfortunately the help file is not helping me ;-( Do you have an idea? Best regards Daniel -
Hi, im writing from an array to an excel sheet and want to use line breaks. The following piece of code does not do this job (instead of the line break the "[...]chr(10)[...]" is displayed in the cell: #include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> ; Create application object and create a new workbook Local $oAppl = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookNew($oAppl) If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example", "Error creating the new workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oAppl) Exit EndIf ; ***************************************************************************** ; Write a 1D array to the active sheet in the active workbook ; ***************************************************************************** Local $aArray1D[3] = ['"Zeile 1 " & vbLf & " Zeile 2"', 'B', 'CC'] _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $aArray1D, "A3") If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example 2", "Error writing to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example 2", "1D array successfully written.") What am i doing wrong? Any help is appreciated. Best regards Daniel
-
Formating Excel-Cells --> Very slow
Basement replied to Basement's topic in AutoIt General Help and Support
Hi, thanx for your answers. @Oscis: I will try out your script tommorow (i'm not at home today) @water: I already tried out, checking the conditions directly in the array and then formatting the Excel-rows - no significant change of performance. But i will try out the screen updating thing. Stay tuned ;-) Now i have to prepare my sons third birthday, Best regards Daniel -
Hey, last question this day. I've got a Excel Sheet with 8000 rows. No i want to go through every row and if cell A contains ".1" format the whole row with grey background color. Here is what i've done and what works...but very very damn slow: Local $oAppl = _Excel_Open() Local $sWorkbook = @ScriptDir & "\Template.xlsm" Local $oWorkbook = _Excel_BookOpen($oAppl, $sWorkbook) ;Copy the 8000 lines from Array to Excel _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet,$arr_final, "A1") ;Autofit $oWorkbook.Activesheet.Columns.Autofit ;Start to format For $i=1 to UBound($arr_final) Step +1 local $col_val=_Excel_RangeRead($oWorkbook, $oWorkbook.Activesheet, "A"&$i) if $col_val=".1" Then $oWorkbook.ActiveSheet.Range("A"&$i&":H"&$i).Interior.ColorIndex = 15 EndIf Next You can watch excel walking through every line of the sheet...and drink tons of coffee ;-) Is there a possibillity to fasten this process? Best regards Daniel
-
Paste ArrayToClip-result in Excel sheet
Basement replied to Basement's topic in AutoIt General Help and Support
Ups, seems that i had an older version of the Excel.au3 in use... Great, that's all i wanted. best regards Daniel -
Paste ArrayToClip-result in Excel sheet
Basement replied to Basement's topic in AutoIt General Help and Support
Hi, but as i know the array then is written line by line to Excel. With an Array of 9000 lines this takes hours. Is there no possibility to paste automatically in table format? Excel has a Paste-function which is called in german version "Textkonvertierungsassistent". When i use this function manually (which i don't want, all is to be done automatically) i can say "separater is semicolon" and then Excel pastes in correct format. Every idea is appreciated... best regards Daniel -
Hi, another day, another question ;-) I want to create an excel-sheet which contains the content of an array. I think the fastest way to transfer the Array's content (which is VERY large, 9000 lines and 30 Columns) is via the function ArrayToClip and then paste it in Excel - so far so right? The problem: When i paste the content into the Excel sheet, it is not pasted in table format (which would mean every Array column is in a separate Excel column). It is pasted in the CSV-semicolon-separared format "content col 1;content col 2;etc) and pasted all in the first cell of the sheet. Is it possible to paste in a way that the structure of the array table is overtaken? Best regards Daniel
-
Hey, here's another try, built by myself, which is very fast (tested in the original script with 8000 lines). The comments are in german and maybe parts of the script could be optimized again (time is running...quick and dirty is the rule for me ;-) I also built-in a piece of code which lets me see which entry was duplicated and which not global $ArrayIn local $i=0 #include "include/Array.au3" ;TestArray Global $arr_ergebnisliste_final[8][4] = [[" ", ".1", "a", 2], _ [" ", "..2", "b", 1], _ [" ", "..2", "c", 2], _ [" ", "...3", "d", 1], _ [" ", "...3", "e", 2], _ [" ", ".1", "f", 1], _ [" ", "..2", "g", 2], _ [" ", "..2", "h", 1]] _ArrayDisplay ($arr_ergebnisliste_final, "Original) While $i < UBound($arr_ergebnisliste_final) _DuplTree($arr_ergebnisliste_final, $i) $i+=1 WEnd _ArrayDisplay ($arr_ergebnisliste_final, "After Copying") ;Make "c"'s to "duplicated" umwandeln For $i=0 to UBound($arr_ergebnisliste_final)-1 Step +1 if $arr_ergebnisliste_final[$i][0]="c" then $arr_ergebnisliste_final[$i][0]="duplicated" Next _ArrayDisplay ($arr_ergebnisliste_final, "Fertig") Func _DuplTree(ByRef $ArrayIn, $Start) $stufenspalte=1 $mengenspalte=3 $multiplier=$ArrayIn[$Start][$mengenspalte] ;Nur Anfangen zu berechnen, falls der Multiplikator des Zweiges größer ist als 1 und der Zweig nicht bereits dupliziert wurde! if $multiplier>1 AND Not ($ArrayIn[$Start][0]="b" OR $ArrayIn[$Start][0]="c") Then ;Erstmal die Zeile des Einstiegspunktes mit einen "b" als bereits bearbeitet markieren! ;Denn Zweige, die bereits einmal dupliziert wurden sollen beim nächsten Durchlauf nicht noch einmal dupliziert werden! if NOT($ArrayIn[$Start][0]="b" OR $ArrayIn[$Start][0]="duplicated" OR $ArrayIn[$Start][0]="c") Then ;Diese Zeilt wurde NOCH NIE bearbeitet oder dupliziert --> klarer Fall für ein "b" $ArrayIn[$Start][0]="b" Else ;Der Datensatz wurde bereits dupliziert...wird mit einem c gekennzeichnet, denn alle C's werden nicht mehr bearbeitet und später zu einem "dupliziert" geändert $ArrayIn[$Start][0]="c" EndIf local $treeSize=1 ; TreeSize ist schon mal eins, denn mindestens eine Zeile wird kopiert! local $startstufe=StringStripWS(StringReplace($ArrayIn[$Start][$stufenspalte], ".", ""),8) ;Im Array vom Startwert solange weiterlaufen bis ein Eintrag mit einer kleineren oder gleichen Stufe kommt. ;Denn dann ist das Ende des Zweiges erreicht und wir wissen schon mal, wie groß der zu duplizierende Zweig werden wird. For $i=$Start+1 to UBound($ArrayIn)-1 Step +1 local $currstufe=StringStripWS(StringReplace($ArrayIn[$i][$stufenspalte], ".", ""),8) ;MsgBox(0, "Vergleich", "Startstufe=" & $startstufe & " --> Currstufe:" & $currstufe) If $currstufe>$startstufe then ;Array-Größe um eins erhöhen $treeSize+=1 Else ExitLoop EndIf Next ;treeSize ist ermittelt und muss nun noch mit der übergebenen Anzahl multipliziert werden, da wir den Zweig ja u.U. mehrmals brauchen ;dann wissen wir zusammen mit der bereits vorhandenen Größe des Arrays, wie groß der gesamte neue Array sein wird. $arrSize=(UBound($ArrayIn)-$treeSize)+($treeSize*$multiplier) ;Temporären Array dimensionieren Dim $arrTmp[$arrSize][UBound($ArrayIn, 2)] ;Von 0 an solange im Array weiterwandern und 1:1 in den neuen Array kopieren, bis wir zum Startwert ($Start) kommen. For $i=0 to $Start-1 Step +1 For $y=0 to UBound($ArrayIn, 2)-1 Step +1 $arrTmp[$i][$y]=$ArrayIn[$i][$y] Next Next $Start_dupl=$Start ;Zweig nun nochmal durchlaufen und in den neuen Array rüberschaufeln ;Jedoch nur noch bis zum bereits gefundenen Zweigende und entsprechend der geforderten Anzahl For $z=1 to $multiplier Step +1 ;MsgBox(0, "Durchlauf z=" & $z, "von " & $Start & " bis " & $Start+($z*$treeSize)) For $i=$Start_dupl to ($Start_dupl+$treeSize)-1 Step +1 For $y=0 to UBound($ArrayIn, 2)-1 Step +1 $arrTmp[$i][$y]=$ArrayIn[$i-(($z-1)*$treeSize)][$y] Next ;Falls KEIN "b" in der Spalte 0 steht gleich noch den Vermerk "dupliziert" in die Spalte 0 rein! ;So wird verhindert, das Zeilen, die breits dupliziert wurden im weiteren Verlauf NOCHMAL dupliziert werden! ;if NOT ($ArrayIn[$i-(($z-1)*$treeSize)][0]="b") then $arrTmp[$i][0]="dupliziert" if NOT($ArrayIn[$i-(($z-1)*$treeSize)][0]="b" OR $ArrayIn[$i-(($z-1)*$treeSize)][0]="c") AND $z>1 then $arrTmp[$i][0]="dupliziert" Next $Start_dupl=$Start_dupl+$treeSize Next local $dupl=0 $Start_dupl=$Start+($multiplier*$treeSize)-1 ;Nun noch die "alten", nicht duplizierten Elemente reinklatschen For $i=$Start+$treeSize to UBound($ArrayIn)-1 Step +1 $dupl+=1 For $y=0 to UBound($ArrayIn, 2)-1 Step +1 $arrTmp[($Start_dupl+$dupl)][$y]=$ArrayIn[$i][$y] Next Next #comments-end $ArrayIn=$arrTmp Else ;Der Multiplikator ist 1 (also nichts zu vervielfachen) ODER die Zeile hat ein "b", was heißt, dass sie bereits bearbeitet wurde! If $multiplier=1 then ;Falls der Multiplikator 1 ist wurde die Zeile (selbst wenn Sie schon mal mit einem anderen Zweig mit dupliziert wurde) SELBER ;garantiert noch nie multipliziert und wird auch nie multipliziert werden (z.b. aus Versehen doppelt) --> D.h. falls schon ein "dupliziert" ;drin steht, NICHT überschreiben mit "b" if NOT ($ArrayIn[$Start][0]="duplicated") Then $ArrayIn[$Start][0]="b" EndIf Else ;Falls der Multiplikator größer 1 ist aber ein b drin steht, wurde die Zeile bereits bearbeitet, aber auch schon dupliziert --> das "b" wird mit "dupliziert" überschrieben $ArrayIn[$Start][0]="duplicated" EndIf EndIf Return $ArrayIn EndFunc
-
Hi, a solution only with autoit would be better... any further suggestions? (or do you have a concrete example solution using SQLite? Because i'm unfortunately not familiar with this technique...) What I've done in the meantime: As the ReDim-Function is very slow (thanx Melba) i've googled and found a few functions, which check, if the array must be "Redimed" at all and if then ReDim the array not just for one Item but multiply the Array size by 1.5. '?do=embed' frameborder='0' data-embedContent>> The script is now a LITTLE BIT faster, but not as fast as anybody can work with it. Any further ideas? best regards Daniel