
MasterRaistlin
Members-
Posts
12 -
Joined
-
Last visited
Everything posted by MasterRaistlin
-
AutoIT3Wrapper + Reshack no longer work
MasterRaistlin replied to MasterRaistlin's topic in AutoIt General Help and Support
No strange symbols in mine. I just changed 2 lines of code and changed the version from 2.45 to 2.46 and that's all. 2.45 compiled perfect. 2.46 didn't. -
Hello, I just ran into a problem today when compiling an exe after I made an update to my script. I did everything the same as before but all of a sudden reshack doesn't want to change the file version, description, etc. I downloaded and replaced both programs but it's still not working. I didn't touch the #compiler messages except to change the version #. Anyone have a similar problem? Thanks
-
Enabling Checkbox from Address Bar
MasterRaistlin replied to MasterRaistlin's topic in AutoIt General Help and Support
nope..controlclick doesn't work. Just to elaborate....I can fill the forms like this "http://blahblahblah.main.jsp?Time=13:00&User=Manny&Date=08/06/2006" so I need to add something to enable the checkbox that's titled "ExcelExport" so that would be... "http://blahblahblah.main.jsp?Time=13:00&User=Manny&Date=08/06/2006&ExcelExport = ?? " -
Ok..this isn't precisely AutoIT related but I'm making a program to do something specific and I thought the great minds here could help. I've discovered on a certain web-page that I want to load for my program that I can fill in different form values using the address bar. For example: The form has an input box for Time so in the address bar I can put "http://blahblahblah.main.jsp?Time = 13:00" and if I hit refresh it will put 13:00 into the time field. My problem is I want to get it to check a checkbox on the form but I can't figure out how to do it from the address bar. I've found the checkbox's name but = true won't work... = 1 won't work =checked won't work....any ideas? Currently I'm tabbing all the way over to it but it's quite cumbersome.
-
Concatenate Variable Names?
MasterRaistlin replied to MasterRaistlin's topic in AutoIt General Help and Support
Sorry..I guess I should have been more specific..... $SymbolInput($x) are a bunch of different input boxes (so called SymbolInput1, SymbolInput2, etc) I have on my GUI and, at the time of running this function, would contain nothing. So what I want to do is, when the user starts this certain function, would load the data in sequence from $symArray and put it into the Input boxes for use in another part of the program (yes..I do need them to be displayed in the Input boxes for the user in this case) -
I've experimented with this but it still doesn't work so I'm wondering if it's even possible. Here's the rundown of what I want to do:(note..not exact code) $iIndex = 6 For $x = 1 to $iIndex $sTempSymbolInput = $SymbolInput & $x ; Wanting end result of $sTempSymbolInput to be $SymbolInput1 GuiCtrlSetData($sTempSymbolinput, $symArray[$x - 1]) Next Is it clear what I'm trying to do? Is this possible or is there another function I can call from within AutoIt?
-
Comparing txt files problem
MasterRaistlin replied to MasterRaistlin's topic in AutoIt General Help and Support
ok...update....there were serious problems with the arraysearch function...now I think I fixed it but it only enters the IF statement once and I can't figure out why. I tried If $avArray[$iCurrentPos] = $vWhat2Find Then and then switched it to what it says below in case it was reading the strings differently but it still doesn't work. So, with the same data as posted above, it gets rid of 1 of the matching entried.Any ideas? Func _ArraySearch($avArray, $vWhat2Find) Local $iCurrentPos Local $iUBound Local $iStart $iUBound = UBound($avArray) - 1 $iStart = 1 For $iCurrentPos = $iStart To $iUbound $iCurrentPos = $iCurrentpos +1 If StringinStr($avArray[$iCurrentPos],$vWhat2Find) > 0 Then Return $iCurrentPos endif Next Return 0 EndFunc ;==>_ArraySearch Func _CompareFiles($filename_1, $filename_2) $sFileName_1 = $filename_1 $sFileName_2 = $filename_2 $FileName_Diff = @scriptdir & "\Compared_DIFF.txt" Dim $File1Array[1200], $File2Array[1200] Global $File1Offset = 0, $File2Offset = 0 ; Create an empty file for writing the result to. $File_3 = FileOpen($FileName_Diff, 2) If $File_3 = -1 Then MsgBox(0, "Error", "Unable to create file : " & $FileName_Diff) Exit EndIf FileClose($File_3) ; Open the first file $File_1 = FileOpen($sFileName_1, 0) If $File_1 = -1 Then MsgBox(0, "Error", "Unable to open file : " & $sFileName_1) Exit EndIf $File_2 = FileOpen($sFileName_2, 0) If $File_2 = -1 Then MsgBox(0, "Error", "Unable to open file : " & $sFileName_2) Exit EndIf _FileReadToArray ($sFileName_1, $File1Array) _FileReadToArray ($sFileName_2, $File2Array) For $i = 0 To UBound ($File1Array) - 1 $i = $i + 1 If _ArraySearch($File2Array, $File1Array[$i]) = 0 Then $DidWrite = Write_Diff_Log($FileName_Diff, $File1Array[$i]) EndIf Next EndFunc -
So I was attempting to work the ideas at this post into my program http://www.autoitscript.com/forum/index.ph...topic=18819&hl= But for some reason _ArraySearch is not comparing the items in the arrays correctly. All the program ends up doing is spitting out the first list again. Can anyone figure out what's wrong?? I've included the text files for example. I want the end result to be that if an item in the dailylist file is not found in the craplist file for it to be written to a third file. Thanks Func _CompareFiles($filename_1, $filename_2) $sFileName_1 = $filename_1 $sFileName_2 = $filename_2 $FileName_Diff = @scriptdir & "\Compared_DIFF.txt" Dim $File1Array[1200], $File2Array[1200] Global $File1Offset = 0, $File2Offset = 0 ; Create an empty file for writing the result to. $File_3 = FileOpen($FileName_Diff, 2) If $File_3 = -1 Then MsgBox(0, "Error", "Unable to create file : " & $FileName_Diff) Exit EndIf FileClose($File_3) ; Open the first file $File_1 = FileOpen($sFileName_1, 0) If $File_1 = -1 Then MsgBox(0, "Error", "Unable to open file : " & $sFileName_1) Exit EndIf $File_2 = FileOpen($sFileName_2, 0) If $File_2 = -1 Then MsgBox(0, "Error", "Unable to open file : " & $sFileName_2) Exit EndIf _FileReadToArray ($sFileName_1, $File1Array) _FileReadToArray ($sFileName_2, $File2Array) For $i = 1 To UBound ($File1Array) - 1 If _ArraySearch($File2Array, $File1Array[$i]) = "" Then ;Guictrlsetdata($testlabel,$file1Array[$i]); testing label $DidWrite = Write_Diff_Log($FileName_Diff, $File1Array[$i]) If $DidWrite = 0 Then MsgBox (0, "Error", "Could not write to file") Exit EndIf EndIf Next EndFunc ; This function adds a Message in a File ; It returns 0 on failure ; It returns 1 on success Func Write_Diff_Log($LogFileName, $LogMessage) Local $File_3 Local $WriteToFile_3 $File_3 = FileOpen($LogFileName, 1) If $File_3 = -1 Then Return 0 EndIf $WriteToFile_3 = FileWriteLine($File_3, $LogMessage & @CRLF) If $WriteToFile_3 = -1 Then Return 0 EndIf FileClose($File_3) Return 1 EndFunc ;=============================================================================== ; ; Description: Finds an entry within an one-dimensional array. (Similar to _ArrayBinarySearch() except the array does not need to be sorted.) ; Syntax: _ArraySearch($avArray, $vWhat2Find, $iStart = 0, $iEnd = 0,$iCaseSense=0) ; ; Parameter(s): $avArray = The array to search ; $vWhat2Find = What to search $avArray for ; $iStart (Optional) = Start array index for search, normally set to 0 or 1. If omitted it is set to 0 ; $iEnd (Optional) = End array index for search. If omitted or set to 0 it is set to Ubound($AvArray)- ; $iCaseSense (Optional) = If set to 1 then search is case sensitive ; Requirement(s): None ; Return Value(s): On Success - Returns the position of an item in an array. ; On Failure - Returns an empty string "" if $vWhat2Find is not found ; @Error=1 $avArray is not an array ; @Error=2 $iStart is greater than UBound($AvArray)-1 ; @Error=3 $iEnd is greater than UBound($AvArray)-1 ; @Error=4 $iStart is greater than $iEnd ; @Error=5 $iCaseSense was invalid. (Must be 0 or 1) ; Author(s): SolidSnake <MetalGearX91@Hotmail.com> ; Note(s): This might be a bit slower than _ArrayBinarySearch() but is useful when the array's order can't be altered. ;=============================================================================== Func _ArraySearch($avArray, $vWhat2Find, $iStart = 0, $iEnd = 0, $iCaseSense = 0) Local $iCurrentPos, $iUBound If Not IsArray($avArray) Then SetError(1) Return "" EndIf $iUBound = UBound($avArray) - 1 If $iEnd = 0 Then $iEnd = $iUBound If $iStart > $iUBound Then SetError(2) Return "" EndIf If $iEnd > $iUBound Then SetError(3) Return "" EndIf If $iStart > $iEnd Then SetError(4) Return "" EndIf If Not ($iCaseSense = 0 Or $iCaseSense = 1) Then SetError(5) Return "" EndIf For $iCurrentPos = $iStart To $iEnd Select Case $iCaseSense = 0 If $avArray[$iCurrentPos] = $vWhat2Find Then SetError(0) Return $iCurrentPos EndIf Case $iCaseSense = 1 If $avArray[$iCurrentPos] == $vWhat2Find Then SetError(0) Return $iCurrentPos EndIf EndSelect Next SetError(0) Return "" EndFunc ;==>_ArraySearchdailylist.txt craplist.txt
-
I tried your code Smoke but it didn't do anything. It actually brought up an error on this line $aStoreDelete &= $i & Chr(01) so I tried is8591's suggestion and it actually runs through the loop this time (proven by my little test label) but now it's giving me a "subscript used with non-array variable" error on this line $sitem = $aHTMLfinal[$i] Which doesn't make sense because 1) I've proven it goes through the loop once because my label placing and 2) it's defined as an array already So what can I do now?
-
Ok...so I changed it to run from the last to the first. Except it's not removing the ones that have greater length than 3. I even put in a test label to check and it's not getting the lengths at all. Anyone know why? $aHTMLfinal = StringSplit($sHTMLfinal, " ") $i_Base = 1 $I_Ubound = UBound($aHTMLfinal) - 1 For $i = $i_UBound To $i_Base $sitem = $aHTMLfinal[$i] Guictrlsetdata($testlabel, Stringlen($sitem)) if StringLen($sitem) > 3 then $aHTMLfinal= _Arraydelete($aHTMLfinal,$i) endif Next
-
Ok...so I'm trying to search through the Array that StringSplit created and delete the elements that have more than 3 characters. However, when I implement this code I keep getting an "Array variable has incorrect number of subscripts...." error message. What am I doing wrong?? $aHTMLfinal = StringSplit($sHTMLfinal, " ") $i_Base = 0 $I_Ubound = UBound($aHTMLfinal) - 1 For $i = $i_Base To $i_UBound $sitem = $aHTMLfinal[$i] if Stringlen($sitem) > 3 then _Arraydelete($aHTMLfinal,$i) endif Next Thanks!