Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/10/2013 in all areas

  1. playlet

    ---

    ---
    1 point
  2. guinness

    Output lies!

    You're welcome.
    1 point
  3. guinness

    Output lies!

    Use the basic editor by selecting the toggle edit button.
    1 point
  4. guinness

    Output lies!

    What did you decide to do? Perhaps using the Default keyword in your functions would be a wise decision. OnAutoItExitRegister('SomeFuncWrapper') SomeFunc(10) Func SomeFunc($iValue = 0, $sString = Default, $hVar = 0x00000000) ; If the Default keyword is passed then set the default parameter and thus you don't have to remember the optional parameters. If $iValue = Default Then $iValue = 0 If $sString = Default Then $sString = 'SomeString' If $hVar = Default Then $hVar = 0x00000000 ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iValue = ' & $iValue & @CRLF & '>Error code: ' & @error & @CRLF) EndFunc ;==>SomeFunc Func SomeFuncWrapper() SomeFunc(Default, Default, Default) ; Instead of having to refer back to the function. e.g. ; SomeFunc(0, Default, 0x00000000) ; Because if you change the optional parameters of SomeFunc() and forget to update this function, then it could lead to problems. EndFunc ;==>SomeFuncWrapper
    1 point
  5. Jos

    Output lies!

    Check this to see what I mean: OnAutoItExitRegister("MyTestFunc") MyTestFunc(10) Func MyTestFunc($test=1) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $test = ' & $test & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console EndFunc ;==>MyTestFunc Jos
    1 point
  6. Instead of doing the Save As, you can do $sHtml = _IEDocReadHTML($oIE) $file = FileOpen("your-filename.html", 2) FileWrite($file, $sHTML) FileClose($file) You can also use _IEBodyReadHTML instead to avoid the header area and scripts, etc in the file. It is also easy to parse the company name and address info out of the HTML with IE.au3, once you work with it a bit more. Dale p.s. Also note the structure of the URL you get when you navigate to one of your target pages. You could also easily construct the URL strings that you need and get the file contents with INetGetSource()
    1 point
  7. Something like this: _IENavigate($oIE, $aLines[$1] & "/mysite1.org", 0) ; navigate to site #1 _IELoadWait($oIE, 0, 60000) ; Wait for 1 minute If @error Then _IENavigate($oIE, $aLines[$1] & "/mysite2.org") ; navigate to site#2
    1 point
  8. FireFox

    Notepad Save as ...

    of course. btw, please use [autoit][/autoit] tags to post your code
    1 point
  9. water

    GUI BROWSER

    If you use the Internet Explorer then please have a look at the builtin IE UDF. Function _IECreateEmbedded allows to create a browser object in a GUI. But it might be hard to display just a region of a site.
    1 point
  10. playlet

    ---

    ---
    1 point
  11. czardas

    calculation

    I don't understand you. You are reading the controls (one time only) before you have time to type anything into them. So you are doing a calculation on nothing. The answer you get will always be wrong, unless you put GUICtrlRead in the right place (inside the while loop). I can't think of any simpler way to explain this.
    1 point
  12. FireFox, This script limiting an input to valid numbers should help: #include <WindowsConstants.au3> #include <EditConstants.au3> Global $iDecimal = 2 GUICreate("Input Filter", 300, 30, -1, -1) Global $inTest = GUICtrlCreateInput("", 5, 5, 290) GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") GUISetState(@SW_SHOW) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $iIDFrom = BitAND($wParam, 0xFFFF);LoWord Local $iCode = BitShift($wParam, 16) ;HiWord If $iIDFrom = $inTest And $iCode = $EN_CHANGE Then $Read_Input = GUICtrlRead($inTest) If StringRegExp($Read_Input, '[^\d.-]|([{0-9,1}^\A-])[^\d.]') Then $Read_Input = StringRegExpReplace($Read_Input, '[^\d.-]|([{0-9,1}^\A-])[^\d.]', '\1') $Point1 = StringInStr($Read_Input, ".", 0) $Point2 = StringInStr($Read_Input, ".", 0, 2) If $Point2 <> 0 Then $Read_Input = StringLeft($Read_Input, $Point2 - 1) If $Point1 <> 0 Then $Read_Input = StringLeft($Read_Input, $Point1 + $iDecimal) GUICtrlSetData($inTest, $Read_Input) EndIf EndFunc ;==>_WM_COMMAND M23
    1 point
×
×
  • Create New...