Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/05/2012 in all areas

  1. Shutdown seems to be a popular function these days! I've seen at least 2 or 3 questions asking about the parameters and what they mean etc.
    1 point
  2. Hi, leuce. In the time it took you to write all that out, you could have tried out the various options and decided for yourself which one works best for you
    1 point
  3. Don't worry! Solved by RTFM! The answer is yes, I should do bitwise comparison... If BitAND(GUICtrlRead($RadioOutputPNG), $GUI_CHECKED) Then EDIT: For completeness, if you want to check that a radio/checkbox is checked AND enabled then I think you need to do two different comparisons. I was expecting this to work but it doesn't... If BitAND(GUICtrlRead($CheckboxText), $GUI_CHECKED, $GUI_ENABLE) ThenBecause GUICtrlRead() doesn't return the state for checkboxes. Instead you have to additionally check GUICtrlGetState()... If BitAND(GUICtrlRead($CheckboxText), $GUI_CHECKED) AND BitAND(GUICtrlGetState($CheckboxText), $GUI_ENABLE) Then This is something that I just fell into because of the wording in the help under GUICtrlRead()... http://www.autoitscript.com/autoit3/docs/functions/GUICtrlRead.htm In the table under the "Return Value" section, the "Checkbox, Radio" row has a link to this table of states... http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetState.htm#StateTable By linking to that table in the return value on the GUICtrlRead() page, I assumed that all the items in that table of states would be valid return values for GUICtrlRead() but it turns out to not be the case. I'm not an expert so I might be wrong here and I would appreciate someone correcting me if I am wrong But I hope this helps someone out! Cheers, B
    1 point
  4. DaleHohm

    Catching IE download.

    This is stripped from code I use in a production app: _IEErrorHandlerRegister() ; Instantiate AJAX object in browser and get reference $oIE.document.parentWindow.eval("var oXHR = new XMLHttpRequest();") $oXHR = $oIE.document.parentWindow.eval("oXHR;") ; The URL of the file as referenced on the page $sURL = "your-url" ; Capture the file via Ajax $oXHR.open("GET", $sURL, False) $oXHR.send() If @error = $_IEStatus_ComError Then ConsoleWrite("COM Error downloading file." & @CRLF) EndIf $sRawFile = $oXHR.responseText ; Save raw file $s_file = @ScriptDir & "downloaded-file.ext" $h_file = FileOpen($s_file, 2) If $h_file = -1 Then ConsoleWrite("Failed to open: " & $s_file & " to output raw file") Else FileWrite($h_file, $sRawFile) FileClose($h_file) EndIf
    1 point
  5. 1 point
  6. The operator precedence is described here. That's why you need brackets.
    1 point
  7. Another solution would be to use a small Database instead of a plain text file. Anyway listen to what water says as he knows what he's talking about.
    1 point
  8. On this forum we try to tell a man how to fish and not hand feed him for the rest of his life. The "relatively simple question" you ask has already been answered in the first post: "Writing to the same file simultaneously is not recommended even with multi-core"
    1 point
  9. New Version - 4 Oct 2012 Added - The ability to hide Hidden and System files/folders. Adding 4 and/or 8 to the $iDisplay parameter removes these from the returned array. Warning: Getting the UDF to hide these files/folders seriously increases the time taken (250% of current version) as the attributes of every file/folder need to be examined. But there is a only very slight penalty (~1%) if these files/folders are not hidden (as in the previous versions). Thanks to Syed23 for the idea; BrewManNH and AZJIO for suggesting some implementation details. New UDF, example and zip in first post. M23
    1 point
  10. CaptainGadget, That is what I have been working on. There will always be a small penalty to pay as we have to check for the "need to look at the attributes" flag, but in my testing that has proved pretty minimal. The major penalty (250% timing ) will only happen if you do decide to hide the Hidden and/or System files. I think I have it as good as I can get it with the current AutoIt - look out for a new release of the UDF later today. M23
    1 point
  11. An example for you (tested only on VS2012). It's not particularly complicated if you know C++ already, just a bit verbose, but that's usually the price for the good stuff in C++. #include <string> #include <iostream> #include <regex> int main(int argc, char **argv) { std::string data("a.b.c.d"); std::regex pattern("([^.])+(.|$)"); std::regex_iterator<std::string::iterator> it(data.begin(), data.end(), pattern); for(; it != decltype(it)(); ++it) { auto match = *it; if(!match.empty()) std::cout << match[1].str() << std::endl; } return 0; }
    1 point
×
×
  • Create New...