Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   problem with backslash and "replace in file" (https://www.kinook.com/Forum/showthread.php?t=950)

iryshia 03-11-2005 06:33 AM

problem with backslash and "replace in file"
 
I need to replace in file a path, this path contain backslash \. How I do?
Thanks

kinook 03-11-2005 06:50 AM

When using regex mode ('Treat all characters as literals' unchecked) in the Replace in File action, \ is an escape character; use \\ to match a literal backslash character. See the regular expression references listed at http://visualbuild.com/Manual/?filereplaceaction.htm for more details.

abcdetech 07-31-2009 03:42 PM

what if I want to replace a text with a variable %WORK_ROOT%

where %WORK_ROOT% defined as c:\temp\bin?

After testing my step I'm getting :

c:tempbin

(missing backslashes)

kinook 07-31-2009 04:43 PM

[Replace("%WORK%_ROOT%", "\", "\\")]

http://www.kinook.com/VisBuildPro/Ma...xpressions.htm
http://www.w3schools.com/Vbscript/func_replace.asp

abcdetech 08-03-2009 09:22 AM

thanks it some how works but doesn't fully do what I intended to do. I should've posted all my string.

I've solved a problem with backslashes but now I'm getting a problem with a $

I need to insert this string

%WORK_ROOT%\bin\$ConfigurationName between tags.

where %WORK_ROOT% is defined as c:\temp

after implementing your tip I'm getting:

c:\temp\bin\$ConfigurationName<\HintPath>

can't figure out how to solve a problem with the $ symbol.

I'm expecting to see:

c:\temp\bin\Debug<\HintPath>
c:\temp\bin\Release<\HintPath>
c:\temp\bin\Debug_MT<\HintPath>..........

thank you

kinook 08-03-2009 09:56 AM

I guess you're doing something like
http://www.kinook.com/Forum/showthre...?threadid=4076

but using $(ConfigurationName) rather than $(OutDir)? Those types of macros/variables are resolved by Visual Studio, not by VBP. They will not be replaced by an actual configuration name in the project file, but will instead be interpreted and converted by VS when building the project.

When using an expression like that in the replacement field of the Replace in File action, you need to escape the parentheses (see the attachment in the link above):
$\(ConfigurationName\)


All times are GMT -5. The time now is 02:40 PM.


Copyright © 1999-2023 Kinook Software, Inc.