Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Evaluate/Modify is Killing me

Status
Not open for further replies.

leit0050

Technical User
Sep 4, 2007
29
0
0
US
OK,
I have C++ builder 2007 and the evaluate modify is driving me insane! I know I can do cntrl F7 on any integer value, click evaluate, type in the new value and do modify and everything is perfect.
For some reason, I cannot do the same thing for a string. For example if I have a string
AnsiString msg;

and I do evaluate modify for the msg I get the evaluate modify dialog box. If I click evaluate, I even get the string that is supposed to be in the string under new value

{"c:\\Somepath"}

now if I change new value to anything, for example
{"c:\\newpath"} or "c:\\newpath" I get the error

E2188 expression syntax.

How in the world do you modify a string in debug mode using builder?
 
Could it be that You're typing the value in and thus does NOT need the duble backslash?

"c:\\newpath" written as constant in the program will, in run-time, be "c:\newpath" whereas it will be interpeted as "c:\" '\n' "ewpath" (i.e. "c:\", Newline [never exist in ANSIstring]...) in "runtime".

Remidy: type "c:\newpath"

Totte
Keep making it perfect and it will end up broken.
 
Thank you for getting back to me. That does seem to help some but it still doesn't work. If I just try to type in "cat" and do modify, the evaluate/modify window will show "cat". However, in the local variables window, it will show the string containing {""}.
If I click on evaluate, the result field shows {""} as well. It doesn't seem like the string takes the value I type in. Any ideas?
 
Nope, i'm still stuck with BCB6

Totte
Keep making it perfect and it will end up broken.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top