Syntax

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Peter

Syntax

Post by Peter » Tue Jul 15, 2003 6:49 pm

I just spent a couple hours trying to figure out why a simple script wasn't working. Finally I noticed that the statement

Release CTRL

had a space at the end. This prevented the statement from executing. Is this normal behavior?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Jul 15, 2003 9:54 pm

Yes, it is normal.

But...in the Editor there is a command to deal with that.

Click on Edit, Remove Trailing Spaces, and all trailing spaces will be removed. I think that menu option was introduced in release 7.2.031, so you might not have it if using an earlier version.

Trailing spaces frequently will show up when doing a cut and paste from code in this forum if the code is not surrounded with the "pre" and "/pre" codes.

Hope this helps.....good luck
Bob

Peter

Post by Peter » Tue Jul 15, 2003 11:16 pm

Thanks. I'm amazed that a trailing space can be such a problem and even more amazed that the program doesn't give a warning when such a problem exists.

I'll be remembering the function to remove trailing spaces.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Jul 15, 2003 11:47 pm

Hi Peter.....you commented:
amazed that the program doesn't give a warning when such a problem exists.
Following that thought, why not remove all leading spaces also?

Sometimes trailing spaces are wanted, so Macro Scheduler does not try to "know what you want" like many other programs.

I don't think this really became a big issue until using the forum to cut and paste code causing problems like yours. And that is a function of the forum software which is not written by MJT.

Personally, I prefer having the option to do things in multiple ways, provides a lot more flexibility.

Re your other comment:
amazed that a trailing space can be such a problem
Computers are not smart at all. They do exactly as they are told, and that is what these macro scripts are doing, telling the computer to read exactly what you provide and respond accordingly. If you put a space there, the program will try to use it.

Too bad it was so tough for you to find the cause of your trouble, but it will be a lesson well learned. Most of us have been through similar issues. Lot's to pick up from this forum......enjoy!

Peter

Post by Peter » Wed Jul 16, 2003 2:31 am

Hi Bob,

I don't want to make a big deal about this, but I don't understand the philosophy behind the manner in which this error is handled. If the software decides a statement isn't valid and therefore won't be executed, it should notify the user about that condition.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts