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

tcc/le 12.00.29 - confounded by percent signs

Discussion in 'TCC/LE Support' started by Gorlash, Oct 19, 2010.

  1. Gorlash

    Joined:
    Jan 22, 2010
    Messages:
    12
    Likes Received:
    0
    I'm trying to write a command-line utility, which accepts command-line arguments that contain percent signs. tcc/le is stripping out the percent signs from the input, before passing it to main(). cmd.exe does not do this. Is there something I can do to avoid this translation??
     
  2. Gorlash

    Joined:
    Jan 22, 2010
    Messages:
    12
    Likes Received:
    0
    Okay, one way I can handle it is to put the argument in back-quotes.
    That will suffice if no configuration-specific options come up here.
     
  3. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    Gorlash wrote:

    | I'm trying to write a command-line utility, which accepts
    | command-line arguments that contain percent signs. tcc/le is
    | stripping out the percent signs from the input, before passing it to
    | main(). cmd.exe does not do this. Is there something I can do to
    | avoid this translation??

    One alternative is to use the /X option of the SETDOS command, esp. 3
    and 4. Another alternative is to double the percent signs. Furthermore, any
    text enclosed in `backticks` (as this word is) is not evaluated. Be careful
    and verify that many samples are transmitted in the form desired, esp. if
    you need to evaluate some environment variables while you construct the
    lines, while you want to pass the percent sign for delayed evaluation.
    --
    Steve
     
  4. Gorlash

    Joined:
    Jan 22, 2010
    Messages:
    12
    Likes Received:
    0
    HA!! Hoist by me own petard... your suggestion indeed worked great, and I though that would be the end of, since I don't write batch files and have no need to do percent-sign conversions...

    except that I *do* use that feature - in my PROMPT!!
    set prompt=`%@exec[@color 10 on 1 & echos %@lower[%_cwd] & color 13 on 0 & echos Yes, Master?? & color 3 on 0] $g `

    So I guess I'll have to stick with the back-quote method, which works fine.

    The problem I was trying to solve, and *have* solved, is that I wanted to take links from Google Earth, and paste them into Firefox for display. However, Google Earth renders URLS with special characters encoded as %HH :
    http://freewarehome.com/index.html?
    http%3A//freewarehome.com
    /bx/index.php%3Faction%3Dvthread%26forum%3D2%26topic%3D8048

    If I paste that verbatim into Firefox, it doesn't handle it properly, so I wrote a little C utility that takes the line in, converts it back to normal characters, and I can paste the result into the browser just fine. Since I'm likely the only person who is ever going to use this function, the back-quote solution is not a problem.

    Thanks for the great response!
     

Share This Page