Award
Congratulations DJ Sures, for answering the question and has received an EZ-Credit award! Share what you have learned and create a tutorial to help others by clicking here.

Script Writing Questions

Assistance Requested

Help Toymaker with their question and receive $10 of EZ-Credit to get more robots and parts from our store. The following information was provided about their previous efforts searching tutorials for a resolution.

Toymaker claims to have checked these sources:
 
#1

DJ, please do not see this as a criticism, I remain one the biggest fans of your great work!

Now I am doing extensive script writing for the ALTAIR robots, there are a couple of issues that really slow down my EZ_Builder code writing productivity.

The one that really gets me is the EZ-Script Function suggestion box (that I never use) that appears over your code making it hard to see the nearby lines and some times the window seems to lock in position and this takes a few key presses just to get rid of the box. I know this may be useful for some people but for me to say it is annoying is an understatement! Is there a way to turn this off, if not could I please ask that the option is given?

Another thing I noticed is that sometimes you cannot label a code line out (which is helpful when debugging) even with a "#" place in front of the code line it still gets parsed - it usually throws up a syntax error here is an example

"syntax error on line 67,Unknown command # $LIGHT=setbits(0,0,0,0,0,0,$bit7,$bit6)"

If I take the hash symbol away then it works again?

Thanks for anything you can do here.

Tony

I have found a few conversations, tutorials and activities that may help with your question. Take a look at these links. I've sorted them by what I believe to be most relevant but that is not always the case as I'm still learning.


Also, consider reviewing the Learn section for informative lessons and activities. Check it out!


#2

Hmmm, I am going to have to agree with Tony on the first part.... The pop up script suggestion box gets in the way and it's difficult to get it to close out (which obscures the line you are trying to type on)....

#3

Yep, I find this annoying as well regarding the pop up being in the way, but just thought it was me! Smile

#4

Too funny - it annoys me as well so last week I added an option to disable it.

As for the comment in front of a code line, I don't get an error. Let me take a further look and see how that could possibly happen for you.

#5

I have found I can get rid of the pop up boxes with the escape key or by double clicking on the grey bar in the bottom of the box.
I have also noticed, the odd time, that a line with a # in front of will be parsed. It usually happens after I have made a lot of changes to a script without saving it periodically.

#6

Thanks DJ! The labeling out of a code line issue does not always happen - it seems to occur when you have a script and then start labeling out to debug the code I am not sure what the link is yet? I just got it (a syntax error) when I labelled (#) out a UARTInit line.

Tony

#7

I'm still an idiot when it comes to writing scripts but I've spent a fair amount of time writing simple scripts. Not as much though in comparison to some of the coding wizards around here. At first the suggestion box was a godsend. After a while it got annoying. Thanks for adding the option to disable it. This is funny because I think I was one of the people asking for this feature to be added a few years ago. Sorry Tony. Winky

I also have noticed odd annoying behavior with labeling and disabling lines. I noticed that if I place a # at the beginning of a line to disable it and already have a # at the end of the code (but in front of my label) my script would hang there or I'd get the syntax error Tony mentions. Hope this helps and can be fixed. Smile

#8

Thanks for the update DJ it is appreciated!

The labeling out of lines is still an issue for me. Some of my scripts are now very complex and to debug them efficiently by stopping certain lines from working is essential to find where a problem is. When I label (#) lines out the moment sometimes this causes a syntax error dialogue and the whole script stops, you cannot even save the script until the syntax error is removed (taking out the hash sign).

Another sign of this problem (as Dave mentioned) is that if the line has a "#" after the code to explain what is happening, then placing a "#" at the start of the line will always cause a syntax error.

Try this example (after initializing the uart))

Open a new script then type "uartwrite(0,0,$byte1,$byte2) # send commands" - then click "syntax check" and you will get an ok.

Now add a "#" in front of the line ("# uartwrite(0,0,$byte1,$byte2) # send commands"Winky and you will now get a syntax error?

I end up having to delete the line (or the comments) to continue, this is a real headache as you have to remember where to put them all back later. To me the ability to temporarily label out code lines is essential to efficient program development and debugging.

I hope it is possible to also sort this issue out.

Tony

#9

Tony,

As I think you already surmised, the problem is with having two comment tags in the same line. Instead of deleting the comment, how about just entering a carriage return to move the comment to the next line, then when done debugging, you can just backspace on that line to move the comment back up.

Personally, I always just put my comments in the line above the command or section I am trying to comment on so I never saw this problem before trying to duplicate what you were seeing.

Alan

#10

Looking into it Smile