Opened 18 years ago
Closed 18 years ago
#278 closed Bug (No Bug)
Au3Check reporting syntax errors on dictionary object.
| Reported by: | aGorilla | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | Other | |
| Version: | Other | Severity: | None |
| Keywords: | Cc: |
Description
It reported this as a syntax error, but the code seems to be working fine:
- $App('App_Retries') += 1
Attachments (0)
Change History (4)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
#include <IE.au3>
Global $App = ObjCreate("Scripting.Dictionary")
If @error Then
; can't use dictionary object here, we don't have one.
MsgBox(0, , 'Unable to create the configuration dictionary.')
Exit ; might as well, we're kind of screwed without it.
Else
$App.Add('App_Retries', 0)
EndIf
Func WebGetPage($url)
$App('App_Retries') = 0
Local $text = _GetPage($url)
$App('App_Retries') = 0
Return $text
EndFunc
Func _GetPage($url)
Local $text, $IE_GetPage
_IEErrorHandlerRegister()
$IE_GetPage = _IECreate($url, 0, 0, 1)
_IELoadWait($IE_GetPage)
if @error Then
$App('App_Retries') += 1
If $App('App_Retries') < 3 Then
Return _GetPage($url)
Else
Return False
EndIf
EndIf
$text = StringStripWS(_IEBodyReadHTML($IE_GetPage), 3)
_IEQuit ($IE_GetPage)
return $text
EndFunc
comment:3 by , 18 years ago
comment:4 by , 18 years ago
| Component: | AutoIt → Other |
|---|---|
| Resolution: | → No Bug |
| Status: | new → closed |
| Version: | 3.2.10.0 → Other |
This script (or similar) would have been better. Yours contains loads of pointless crap and misses something rather obvious. You're making the assumption that just because operator += doesn't throw an AutoIt error, that it works. It does not in work so Au3Check flagging it as an error is actually an improvement over AutoIt's behavior. Now, whether AutoIt should or should not actually support the behavior is another issue entirely.
Global $App = ObjCreate("Scripting.Dictionary")
If @error Then
; can't use dictionary object here, we don't have one.
MsgBox(0, "", 'Unable to create the configuration dictionary.')
Exit ; might as well, we're kind of screwed without it.
Else
$App.Add('App_Retries', 0)
Local $nBefore = $App('App_Retries')
$App('App_Retries') = 1
Local $nAfter = $App('App_Retries')
MsgBox(4096, "", "Before:" & $nBefore & @CRLF & "After: " & $nAfter & @CRLF & "Expected: 1")
$nBefore = $App('App_Retries')
$App('App_Retries') += 1
$nAfter = $App('App_Retries')
MsgBox(4096, "", "Before:" & $nBefore & @CRLF & "After: " & $nAfter & @CRLF & "Expected: 1")
$nBefore = $App('App_Retries')
$App('App_Retries') = $App('App_Retries') + 1
$nAfter = $App('App_Retries')
MsgBox(4096, "", "Before:" & $nBefore & @CRLF & "After: " & $nAfter & @CRLF & "Expected: 2")
EndIf
Closing this as NO BUG as there isn't really a bug here unless it's in AutoIt not throwing an error for the syntax Au3Check knows is invalid.

Your test script leaves a lot to be desired... like everything. Post a real script.