Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/06/2015 in all areas

  1. I ran the code Mikell posted and it works fine for me using AutoIt 3.3.12.0. You're running an older version of AutoIt, you have probably run into a bug that was in the _GUICtrlRichEdit_Create function that was fixed in later versions.
    1 point
  2. JLogan3o13

    Excel _ExcelReadCell

    The function returns a 2D array. Try this. It works for me on a 25-sheet workbook. #include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> Local $oAppl = _Excel_Open() If @error Then Exit ConsoleWrite("Error creating application object" & @CRLF) Local $oWorkbook = _Excel_BookOpen($oAppl, @ScriptDir & "\Unassigned Credit Card Transactions (MAIN REPORT).xlsx") If @error Then Exit ConsoleWrite("Error creating workbook object" & @CRLF) Local $aWorkSheets = _Excel_SheetList($oWorkbook) If @error Then Exit ConsoleWrite("Error enumerating worksheets" & @CRLF) For $i = 0 To UBound($aWorkSheets) - 1 MsgBox(64,"Res", "The Name of worksheet :" & $aWorkSheets[$i][0]) Next
    1 point
  3. Another goodish connection speed day. Well, the good news is that I have not needed to redo the Updater again. The bad, is that this process is taking far longer than expected ... not helped by a headache yesterday and some mind fogs in recent times. Anyway, as much as things pretty much work the same in the program, I am now having to cater for and use the (master) Catalog.ini file. This means I must ensure it is modified whenever it needs to be along with the usual user file keys and values. One benefit so far, is that if another user has indicated a shared item is bought, you will get a splash displaying briefly to tell you so when you select it. This even caters for multiple buyers of the same item. I've been working on the new update in fits and starts, but much has been done and I am making progress. Aside from that, v3.4 continues to still work for me without issue, so I guess there is no hurry ultimately for v4.0.
    1 point
  4. BrewManNH

    Excel _ExcelReadCell

    Use _Excel_RangeRead instead. And please pick a smaller font.
    1 point
  5. galan2015, You have discovered a bug in _FileWriteToLine - when it was rewritten the check for an error in the $bOverWrite parameter was badly formatted and so it fails regardless of the setting. I will fix it for the next release but you can use this modified function in the meantime: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <ComboConstants.au3> #include <File.au3> $sFilePath = @ScriptDir & '\ostatniedane.txt' ; Simulate creation of the file FileDelete($sFilePath) FileWrite($sFilePath, "Fixed" & @CRLF & "Replaceable") $sCheck = FileRead($sFilePath) MsgBox($MB_SYSTEMMODAL, "Content", $sCheck) $hGUI = GUICreate("Test", 500, 500) $Combo5 = GUICtrlCreateCombo("", 184, 98, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData($Combo5, "http://craigslist.org|http://reddit.com|http://google.com|http://gmail.com") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Combo5 ZapisywanieMiejscaProgramu() EndSwitch WEnd Func ZapisywanieMiejscaProgramu() Switch GUICtrlRead($Combo5) Case 'http://craigslist.org' _FileWriteToLine_Mod($sFilePath, 2, '1', True) Case 'http://reddit.com' _FileWriteToLine_Mod($sFilePath, 2, '2', True) Case 'http://google.com' _FileWriteToLine_Mod($sFilePath, 2, '3', True) EndSwitch $sCheck = FileRead($sFilePath) MsgBox($MB_SYSTEMMODAL, "Content", $sCheck) EndFunc ;==>ZapisywanieMiejscaProgramu Func _FileWriteToLine_Mod($sFilePath, $iLine, $sText, $bOverWrite = False) If $iLine <= 0 Then Return SetError(4, 0, 0) If Not IsString($sText) Then $sText = String($sText) If $sText = "" Then Return SetError(6, 0, 0) EndIf If $bOverWrite = Default Then $bOverWrite = False If Not (IsBool($bOverWrite) Or $bOverWrite = 0 Or $bOverWrite = 1) Then Return SetError(5, 0, 0) ; For old versions. If Not FileExists($sFilePath) Then Return SetError(2, 0, 0) Local $aArray = FileReadToArray($sFilePath) Local $iUBound = UBound($aArray) - 1 If ($iUBound + 1) < $iLine Then Return SetError(1, 0, 0) Local $hFileOpen = FileOpen($sFilePath, FileGetEncoding($sFilePath) + $FO_OVERWRITE) If $hFileOpen = -1 Then Return SetError(3, 0, 0) Local $sData = "" $iLine -= 1 ; Now the array is 0-based, so reduce the line number by 1. For $i = 0 To $iUBound If $i = $iLine Then If $bOverWrite Then If $sText Then $sData &= $sText & @CRLF Else $sData &= $sText & @CRLF & $aArray[$i] & @CRLF EndIf ElseIf $i < $iUBound Then $sData &= $aArray[$i] & @CRLF ElseIf $i = $iUBound Then $sData &= $aArray[$i] EndIf Next FileWrite($hFileOpen, $sData) FileClose($hFileOpen) Return 1 EndFunc ;==>_FileWriteToLine That works for me. M23 Edit: Fixed.
    1 point
  6. galan2015, Re-read the help file for _FileWriteToLine and pay particular attention to the $bOverWrite parameter. M23
    1 point
  7. For the time being, I am not looking into fixing any broken links, in any of my topics. Just in case it is for nothing and Jon has to eventually do a rollback and implements a script to fix these types of links. Luckily I have saved web pages, that should help me if I do need to fix ... many wouldn't of course. Very poor form by IPB or whatever they are called, and quite a big bug, having a wide impact when it comes to browsing through older topics. Don't agree with the lack of post number either, which only makes it worse.
    1 point
  8. BrewManNH

    Click until text

    Try this: #include <IE.au3> $oIE = _IECreate("http://temp-mail.org/") Do $mal = _IEGetObjById($oIE, "click-to-delete") _IEAction($mal, "click") $2em = _IEGetObjById($oIE, "mail") Sleep(1000) Until StringInStr(_IEFormElementGetValue($2em), "flurred.com") I couldn't test it before because I was at work, I just tested this and it's working for me.
    1 point
  9. Oops time: need to Zzzz a bit, it's 02:38 here and me answering on the fly is irresponsible!
    1 point
  10. all links in this topic are pointing to himself p.s. (can be useful as an example of selfreferential recursive loop )
    1 point
  11. jguinch

    String

    ? #Include <Array.au3> $url = "http://www.myurl.com" $sHtml = '<P class=row dataid="47" jQueryAbsolut320150502="120"><A class=i href="http://example.com/url.php">' & @CRLF & _ '<P class=row dataid="48" jQueryAbsolut320150502="130"><A class=i href="/get/515151231.html">' & @CRLF & _ '<P class=row dataid="49" jQueryAbsolut320150502="132"><A class=i href="/get/123123.html">' $sHtml = StringRegExpReplace($sHtml, '(?iU)<a class=i href="\K(?!http)', $url) $aLinks = StringRegExp($sHtml, '(?iU)<a class=i href="(.+)"', 3) _ArrayDisplay($aLinks)
    1 point
×
×
  • Create New...