User forums > Using Code::Blocks

Set programs' arguments does not work on Windows CodeBlock

(1/2) > >>

vahalia:
I am using CB on Windows, and my program takes a few arguments. I am trying to set these arguments through Project->Set Programs' Arguments dialog. When my argument string contains a "$" character, strange things happen. Specifically, my argument string is
  2 5 $1N $1N-2HDont
When I run the program, the first two arguments appear correctly in argv[], but the third one is a blank, and the fourth gets changed to -2HDont
Looks like some kind of strange wildcard processing. Can someone explain what is going on and how to work around it? I tried enclosing the args in single quotes or preceding the $ with a backslash, but that too resulted in strange behavior.

Pecan:

--- Quote from: vahalia on October 23, 2020, 02:02:30 am ---I am using CB on Windows, and my program takes a few arguments. I am trying to set these arguments through Project->Set Programs' Arguments dialog. When my argument string contains a "$" character, strange things happen. Specifically, my argument string is
  2 5 $1N $1N-2HDont
When I run the program, the first two arguments appear correctly in argv[], but the third one is a blank, and the fourth gets changed to -2HDont
Looks like some kind of strange wildcard processing. Can someone explain what is going on and how to work around it? I tried enclosing the args in single quotes or preceding the $ with a backslash, but that too resulted in strange behavior.

--- End quote ---

$ is used as a macro prefix in CB. It must be being interpreted incorrectly by the macros manager.

I'll try to recreate the problem

Pecan:
I can replicate the problem.
Until I can find a fix, just prefix two extra $'s in front of the current $.
Like: 2 5 $$$1N $$$1N-2HDont
as a temporary work around.

vahalia:
Thanks. Will try that.

Pecan:
fixed: head r12214

Navigation

[0] Message Index

[#] Next page

Go to full version