Jump to content

Commenting out a continuation line passes full Au3Check but fails at run time


c.haslam
 Share

Recommended Posts

This snippet passed a #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7 check but failed at run time:

Local $sResult = _cFileSelectFolder( _
                    'test', _   ; $title
                    'Desktop', _    ; $sTopItemText
  _ ;                   'My Documents', _   ; $sTopItemText
                    '', _       ; $sInitPath
                    $iWid, _
                    $iHt, _
                    $iLeft, _
                    $iTop, _
                    $hGui, _        ; $hParent
                    $sExclFolders, _
                    $bHideHidden, _
                    $bHideSystem)
Edited by c.haslam
Spoiler

CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard

 

Link to comment
Share on other sites

Post 1 continued:

Message from AutoIt was:

>Running:(3.3.14.5):F:\Program Files\AutoIt3\autoit3.exe "F:\AutoIt scripts\cFileSelectFolder\caller.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"F:\AutoIt scripts\cFileSelectFolder\caller.au3" (26) : ==> Error parsing function call.:
Local $sResult = _cFileSelectFolder( 'test',    'Desktop', _
Local $sResult = _cFileSelectFolder( 'test',    'Desktop', ^ ERROR
->15:00:31 AutoIt3.exe ended.rc:1
+>15:00:31 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 4.972

It appears to me that Au3Check is correct in accepting my code.

You may wonder: why would I want to code like this? I have the arguments to the function on multiple lines so I can readily identify each. In debugging, I wish to change one of the arguments temporarily. It is true that I can work around what looks to be like a deficiency in the parser.

It appears that one can't have a line with only the continuation character (preceded by a space), and followed by an in-line comment

I do not understand why it takes the parser to pickup on this "error".. To me, if it is an error and not a deficiency in the parser, it should be picked up by AU3Check.

Put another way: it would be nice if the parser allowed the code above.

Thoughts?

Edited by c.haslam
Spoiler

CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard

 

Link to comment
Share on other sites

  • Developers
5 minutes ago, c.haslam said:

Thoughts?

Please post something that is runable so we can have a look. 

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@c.haslam
You can't have those lines in that way...

That's how you can do it:

; This will give you "Error parsing function call."
; Local $intBit = BitOR(_
;               1, _
;               0)

; This will not
Local $intBit = BitOR(1, _
                      0 _ ; Or 0)
                     )

ConsoleWrite($intBit & @CRLF)

:)

Edited by FrancescoDiMuro

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

  • Developers

mmm the only reason the first (now commented) fails is because there is a space missing before the first continuation character.

Edit: so this works fine:

; This will give you "Error parsing function call."
Local $intBit = BitOR( _
               1, _
               0)


ConsoleWriteError($intBit & @CRLF)

This does not:

; This will give you "Error parsing function call."
Local $intBit = BitOR( _
               1, _
               _
               0)


ConsoleWriteError($intBit & @CRLF)

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@Jos
Thanks for the tip, didn't know about that :)
By the way, lookking closely at his function call:

Local $sResult = _cFileSelectFolder( _
                    'test', _   ; $title
                    'Desktop', _    ; $sTopItemText
  _ ;                   'My Documents', _   ; $sTopItemText ; -----> This line of code
                    '', _       ; $sInitPath
                    $iWid, _
                    $iHt, _
                    $iLeft, _
                    $iTop, _
                    $hGui, _        ; $hParent
                    $sExclFolders, _
                    $bHideHidden, _
                    $bHideSystem)

Maybe that? :)

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

  • Developers

check my edit...  that explains the issue of the initial post.

PS: au3check used to check for the missing space before a continuation character but we had to disable that check due to other issues caused by that check.

Jod

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Here is a simple case:

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7

foo('cat', _
    'white', _
 _ ;    'black', _
    'short')

Func foo($ani,$colour,$fur)
    MsgBox(0,'',$colour&' '&$ani&' has '&$fur&' fur')
EndFunc

 

Spoiler

CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard

 

Link to comment
Share on other sites

  • Developers
Just now, c.haslam said:

Here is a simple case:

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7

foo('cat', _
    'white', _
 _ ;    'black', _
    'short')

Func foo($ani,$colour,$fur)
    MsgBox(0,'',$colour&' '&$ani&' has '&$fur&' fur')
EndFunc

 

I have already have posted a even simpler example in my earlier post. The issue is the continuation character on its own on a line as all comments are ignored.  

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

No problem, and I don't know whether it is to be labelled as bug, but just post a simple scriptlet in TRAC to report it and let Jon determine whether this is a Bug.  :)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...