Sign in to follow this  
Followers 0
NirKlieman

Syntax errors

7 posts in this topic



Hi all

My code works pretty fine, but when I check it via the Syntax-Check-Prod I got many errors such as:

"C:\Projects\qasa_GWAPP_Tests_6.6\misc\Call Generator\AutoIt3\AutoIT_scripts\emsFuncsOnebox.au3"(555,81) : error: _IEGetObjById() called with Const or expression on ByRef-param(s).
   _IEAction(_IEGetObjById(_IEFrameGetCollection($oIE, 1), "jqi_state0_buttonOk")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Projects\qasa_GWAPP_Tests_6.6\misc\Call Generator\AutoIt3\Include\IE.au3"(1882,41) : REF: definition of _IEGetObjById().
Func _IEGetObjById(ByRef $oObject, $sId)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

for line of code such as:

   _IEAction(_IEGetObjById(_IEFrameGetCollection($oIE, 1), "jqi_state0_buttonOk"), "Click")
 

[Get frame #1 in IE object, search for object with ID "jqi_state0_buttonOk", and Click on it]


Can you help me fix the syntax (or the syntax-checker) so I won't see these errors?


Thanks

 

Share this post


Link to post
Share on other sites



Try putting the result of _IEFrameGetCollection($oIE, 1) into a variable and use the variable in the _IEGetObjById() functions, as the helpfile states the Param is ByRef.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Jos

Thanks. After I did what you said and did the same for the result of Object it stopped invoke errors.

$oFrame = _IEFrameGetCollection($oIE, 1)
   $object = _IEGetObjById($oFrame, "jqi_state0_buttonOk")
   _IEAction($object, "Click")


but now I get three lines of code instead of one, and it makes the code ugly. 
Is there any way to avoid it (except using a function ) ?

Thanks a lot !
 

Share this post


Link to post
Share on other sites

but now I get three lines of code instead of one, and it makes the code ugly. 
Is there any way to avoid it (except using a function ) ?

Seriously?

Guess the "ugly" comment is really "in the eye of the beholder" and think you should ask yourself whether it is really the case or simply a matter of changing your own expectations.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

ok ok .. THANKS anyway !

 



Seriously?

Guess the "ugly" comment is really "in the eye of the beholder" and think you should ask yourself whether it is really the case or simply a matter of changing your own expectations.

Share this post


Link to post
Share on other sites

You're welcome ;)

Jos, just know that somehow, after all the fixes that I made, the number of lines was lowered from 2381  to 2373 !!!

Share this post


Link to post
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
Sign in to follow this  
Followers 0