Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

tcc/le 12.00.29 - confounded by percent signs

Jan
12
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??
 
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.
 
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
 
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!
 

Similar threads

Back
Top