Trailing spaces to be automatically performed at each save

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
bensonlr
Newbie
Posts: 4
Joined: Thu Jan 27, 2005 2:15 pm
Location: Oklahoma City, OK

Trailing spaces to be automatically performed at each save

Post by bensonlr » Thu Jan 27, 2005 2:22 pm

I find the trailing spaces popup a little late when I go save because it is only a warning without a way to click remove trailing spaces.

So, when I go to save and forget again to trim the trailing spaces I have to save the file reopen remove the trailing spaces and resave.

I would suggest that if you give the save command and there are trailing spaces add to the notice page a button to remove the trailing spaces and save and another button to save without the removing the spaces.

Thanks for a great program!
LRB

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 » Thu Jan 27, 2005 4:00 pm

The current method allows me to select which lines I want to keep trailing spaces on.

The option you are suggesting (good idea) is all or none. If this is implemented, I would like to see a third option, to manually edit/remove now (Cancel the Save).
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

bensonlr
Newbie
Posts: 4
Joined: Thu Jan 27, 2005 2:15 pm
Location: Oklahoma City, OK

Post by bensonlr » Thu Jan 27, 2005 4:43 pm

Having the 3rd option would be a great idea as well.

I think I will create a save macro that will remove the trailing spaces and save the file.

That will work for now.

If our suggestions make the cut they will show up future versions.

Thanks for your addition.
LRB

Baldrik
Junior Coder
Posts: 24
Joined: Mon Feb 14, 2005 11:11 pm
Location: TA7, UK

Post by Baldrik » Tue Feb 22, 2005 11:11 pm

...or could the need to ever end a line with a blank be removed by having a system variable maybe called VARQUOTEDSTRING=1 meaning literal strings may be enclosed in quotes (but don't have to be) and if they are the quotes aren't part of the value.

eg these would be equivalent:

// assume new system variable is set to mean the new quoty thing
Let>a= a b c d with blanks at end
Let>a=' a b c d with blanks at end '


...or were there other reasons for keeping the ending blanks?

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Use Complex expressions and avoid blanks at end of lines

Post by adroege » Wed Mar 09, 2005 4:47 pm

What about doing this instead?



Let>a={" a b c d with blanks at end "}

...or could the need to ever end a line with a blank be removed by having a system variable maybe called VARQUOTEDSTRING=1 meaning literal strings may be enclosed in quotes (but don't have to be) and if they are the quotes aren't part of the value.

eg these would be equivalent:


// assume new system variable is set to mean the new quoty thing

Let>a= a b c d with blanks at end

Let>a=' a b c d with blanks at end '

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Mar 09, 2005 6:01 pm

Let>a={" a b c d with blanks at end "}
You can already do this.

We can not change the way it works because a) there are valid reasons why you may want a space at the end and b) we must ensure backward compatibility.

You can already use VAREXPLICIT and can already create variables as in your example above. So you have the option already. We cannot enforce a change which would mean people have to edit old scripts to use the above methods. Hence we feel it is best left as an option for the user.

Users that are confident programmers with experience of real programming languages will appreciate the above delimited methods. Those new to programming who don't care about types and whether something is a string or a number or literal or variable can stick to the default method where delimiters don't matter and make use of the warning should they end up with a space that they don't want. And can ignore it if the space was intentional.

Isn't it amazing how Macro Scheduler can work in so many different ways and suit so many types of user?
MJT Net Support
[email protected]

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Wed Mar 09, 2005 6:20 pm

That was the point I was trying to make....... The fact that nothing new needs to be done in this area to handle trailing spaces. Just write the code to avoid this problem. Even when I need to send a space as a keystroke character, I never use Send>(space) as this is too easy to get deleted. I set a variable equal to a space and Send>%myspace% instead.
You can already do this.

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