Jump to content

lamko

Members
  • Posts

    4
  • Joined

  • Last visited

lamko's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hello guys, I can't figure out why the following script is hanging on script is paused icon on the taskbar. Oke1 msgbox is displayed and the script isn't further executing. I've checked with the window info tool if the TITLE, CLASS and INSTANCE were right. So the script is waiting for WinWaitActive but why ?? The window Vervangen is nicely displaying it's content. Opt ("WinTitleMatchMode", 3) ; Script Start - Add your code below here run("notepad") Sleep(2000) Send("{LALT}") Send("w") Send("r") Sleep(2000) ;MsgBox(0,"hello", "oke1") If WinWaitActive("[TITLE:Vervangen; CLASS:Edit; INSTANCE:1]", "") Then Send("{ASC 065}") EndIf MsgBox(0,"hello", "oke2") If ControlSend("Vervangen", "", "[CLASS:Edit; INSTANCE:2]", "This is some text") Then Send("{ASC 065}") EndIf ControlSend has combined sollution for me. Thx fixed
  2. Thx Andy, thats what I was looking for.
  3. Hmm, your code Andy is a bit complicated for me with regular expressions and other things. Sure I could use it as function and pass the parameters to it and don't understand a bit what's happening. But for example could some code with _FileReadToArray or maybe filereadline and stringsplit also work with little coding effort ? The result is maybe the same but I would like to see if it could be done with a little example so i have something more understandble where I could learn from.
  4. I would like to import a CSV file to an array. The problem i'm facing is that I can't read a single value from a array only a whole line. If that is working then I would create a multidimensional array. start file test, test, test test1, test2, test3 end file #include <file.au3> Dim $aRecords, $lines If Not _FileReadToArray("error.txt",$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf For $x = 1 to $aRecords[0] Msgbox(0,'Record:' & $x, $aRecords[$x]) $Columns = StringSplit($lines, ",") for $y = 1 to $Columns[0] MsgBox(0,"Calculate # of Dimensions", "How many: " & $y) MsgBox(0,"Calculate # of Dimensions", "How many: " & $Columns[$y]) next Next aRecords[$x] contains values but then I would like to split to a single values. But my example array $Columns[$y] doesn't even contain a value. Second question And after that I want to create from the two arrays one multidimensional array I've found some code on the internet and would like to integrate my code with it and then create a multidimensional array For example something like this : $array[linenr in file][first value on line] $array[1][1] put on clipboard and paste in another program Dim $lines,$Display, $NumCols $lines = "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday" ;--------------------------------------------------------------------- ;Lets convert a comma delimited string into a single dimension array ;--------------------------------------------------------------------- $Columns = StringSplit($lines, ",") $NumCols = $Columns[0] MsgBox(0,"Calculate # of Dimensions", "How many: " & $Columns[0]) ;--------------------------------------------------------------------- ;Lets build a multidimensional Array with enough columns ;--------------------------------------------------------------------- Dim $array[2][ $Columns[0] ] For $i = 1 To $Columns[0] $array[1][$i-1] = $Columns[$i] Next ;--------------------------------------------------------------------- ;Display comma delimited string to a multidimensional Array ;--------------------------------------------------------------------- For $j = 1 To $NumCols $Display = $Display & "array[1]["&String($j-1)&"]" & Chr(9) & " = " & chr(9) & $array[1][$j-1] & @CRLF Next MsgBox(4096, "Your Multidimensional Array",$Display)
×
×
  • Create New...