Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Sat Nov 27, 2021 3:23 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Comment's causing errors?
Thanked: 0 time(s)  Unread post Posted: Mon Oct 25, 2021 3:59 am 
Active User
Active User



Joined: Sun Oct 17, 2021 9:07 pm
Posts: 32
Been thanked: 0 time(s)
Has thanked: 6 time(s)
Contribution Points: 67
Ok issue when attempting to save my macro - error of trying to parse "ing"
the line at fault is a comment line
Code:
                    // Walking through town not functioning

this errors
Code:
                    // Walking through town not working

this does not error.

It looks like its seeing the substr of function in the comment and trying to use it as a function?


Top
 Profile  
Reply with quote  
 Post subject: Re: Comment's causing errors?
Thanked: 0 time(s)  Unread post Posted: Mon Oct 25, 2021 4:07 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 2218
Location: USA
Been thanked: 520 time(s)
Has thanked: 38 time(s)
Contribution Points: 17606
I couldn't duplicate that problem. I tested with the words you used and even with other combinations of "function" including the word itself and I didn't receive any errors.

If you make a mistake in the syntax it would look like this:
Attachment:
Capture2.PNG
Capture2.PNG [ 11.98 KiB | Viewed 6402 times ]
If it just gave a line number, then it was probably not that line.

I'm sure as a programmer this is going to sound annoying, but BEM doesn't count every line when reporting parsing errors...at least not all the time. For example, it usually only counts the first "begin" if there are multiple begin/end statements; otherwise it doesn't include any other begin/end statements in the count. If it wasn't a commenting syntax error like above, then it wouldn't count any comments either; like in this example:
Attachment:
Capture3.PNG
Capture3.PNG [ 11.81 KiB | Viewed 6402 times ]
When counting you skip over the "begin" because there is only one set (begin/end), you skip over the comments, and then you get the correct error at line 5 which is the mouse.drag missing required information.

If you take the same example and re-order the comments, you can see that if you counted every line it would appear as it was pointing the commented line with "function" in it, but it is still pointing to the mouse.drag line (you have to skip the comments):


Attachments:
Capture4.PNG
Capture4.PNG [ 12.05 KiB | Viewed 6402 times ]

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers
Top
 Profile  
Reply with quote  
 Post subject: Re: Comment's causing errors?
Thanked: 0 time(s)  Unread post Posted: Mon Oct 25, 2021 4:12 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 2218
Location: USA
Been thanked: 520 time(s)
Has thanked: 38 time(s)
Contribution Points: 17606
If you still have the problem or can duplicate it, please post the script and the error message and I'll take a look at it.

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: Comment's causing errors?
Thanked: 0 time(s)  Unread post Posted: Tue Oct 26, 2021 12:17 am 
Active User
Active User



Joined: Sun Oct 17, 2021 9:07 pm
Posts: 32
Been thanked: 0 time(s)
Has thanked: 6 time(s)
Contribution Points: 67
Still does it. I have attached to screenshots showing the only difference between them. literally just have to change the comments line work of working to functioning and it fails
the abort is there because the function is failing, with the comment to explain why

Code:
     begin
          if  Variable.Exists("InTown")
               begin
                    Macro.Abort()
                    // Walking through town not working
                    Function.Execute("CheckHP")
                    if  Variable.Exists("UseAOE")
                         begin
                              Variable.Remove("UseAOE")
                         end
                    if  Variable.Exists("CollectBounty")
                         begin
                              if  Variable.Exists("CollectBounty")
                                   begin
                                        if  Variable.Does not exist("BountyComplete")
                                             begin
                                                  Window.Display html dialog("Debugging", "280", "25", "yes", "Going to Bounty Board")
                                                  // Function.Execute("ClaimBounty")
                                                  //                         Function.Execute("ReturnFromBountyBoard")
                                             end
                                        Variable.Remove("CollectBounty")
                                   end
                         end
                    if  Variable.Does not exist("ClaimBounty")
                         begin
                              // Function.Execute("LeaveTown")
                         end
                    Macro.Break from loop("no")
               end
     end
function


Attachments:
File comment: Saved no error. Only change was the comment line to working
Screenshot_11.png
Screenshot_11.png [ 6.4 KiB | Viewed 6400 times ]
File comment: Error with comment line "functioning"
Screenshot_10.png
Screenshot_10.png [ 27.2 KiB | Viewed 6400 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Comment's causing errors?
Thanked: 1 time(s)  Unread post Posted: Tue Oct 26, 2021 1:52 am 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 2218
Location: USA
Been thanked: 520 time(s)
Has thanked: 38 time(s)
Contribution Points: 17606
Got it; I didn't test it within a function...so that makes more sense.

It's because a function ends with "function", so yes it will give an error because it still reads it and thinks that's the end of the function...only because it's case-sensitive. If you change it to a capital "F" then it won't do it; only the lower case "f".
- I see your point though. I'll make a note of it for future updates; see if there's anything we can do.

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: Comment's causing errors?
Thanked: 0 time(s)  Unread post Posted: Tue Oct 26, 2021 2:26 am 
Active User
Active User



Joined: Sun Oct 17, 2021 9:07 pm
Posts: 32
Been thanked: 0 time(s)
Has thanked: 6 time(s)
Contribution Points: 67
Thank you :)
Typically in any programming language I've used in the past, a comment line is exactly that - a comment - and doesn't attempt to compile it along with the functions. This is what was getting me confused since it wasnt being treated as a comment line. and if it is trying to process that, I wonder how many commented code lines to disable are not actually being disabled?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group