Modify

Opened 12 years ago

Closed 12 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 Changed 12 years ago by Valik

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

comment:2 Changed 12 years ago by anonymous

#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:4 Changed 12 years ago by Valik

  • Component changed from AutoIt to Other
  • Resolution set to No Bug
  • Status changed from new to closed
  • Version changed from 3.2.10.0 to 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.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.