1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Output leading blanks in a string that is "SafeEcho"'s...

Discussion in 'Plugins' started by mathewsdw, Feb 19, 2012.

  1. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    First an apology if one is needed. In the back of my mind I have a dim memory that this "problem" has already been discussed and fixed and/or worked around, but if that is the case I haven't been able to "dig it up" as of this moment. And the problem is really quite simple: %@SafeEcho is "eating" leading whitespace (at least blanks) on the string that it is echoing. Specifically to demonstrate, a batch file containing just this:
    Code:
    @SafeEcho         This is a test
    @SafeEcho #       This is a test
    
    produces:
    Code:
    This is a test
    #       This is a test
    
    all of the leading blanks being "eaten" by the SafeEcho command.

    Well, I really do want those leading blanks, and I'd rather not have the leading pound sign in the output, but, frankly, that's a better option in terms of my goals in writing this batch file than is the leading blanks just "disappearing" altogether. So is there some already-known way to do what I am trying to do?
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    Dadgummit, I did fix that once. But it seems that fix got lost somewhere along the way....

    I've uploaded a new build, which restores the lost bit.
     
  3. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Thank you, Charles, you've made me very happy!!!:) And since I was relatively sure that this "issue" had been "handled" in the past, I was beginning to think that I was starting to remember things that had not happened (really scary) as well as forgetting things that had!!! Thank you yet again!!!!

    - Dan
     
  4. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    In this case, it's my memory at fault, not yours. I think what happened is that I was reviewing the code at some point, forgot why I had made that change, asked myself "What if the user types two spaces before a /? instead of just one?" and put it back the way it was originally.
     

Share This Page