Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-11-2005, 07:33 AM
iryshia iryshia is online now
Registered User
 
Join Date: 02-16-2005
Posts: 7
Question problem with backslash and "replace in file"

I need to replace in file a path, this path contain backslash \. How I do?
Thanks
Reply With Quote
  #2  
Old 03-11-2005, 07:50 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
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.
Reply With Quote
  #3  
Old 07-31-2009, 03:42 PM
abcdetech abcdetech is online now
Registered User
 
Join Date: 04-30-2008
Posts: 18
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 :

<HintPath>c:tempbin</HintPath>

(missing backslashes)
Reply With Quote
  #4  
Old 07-31-2009, 04:43 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
[Replace("%WORK%_ROOT%", "\", "\\")]

http://www.kinook.com/VisBuildPro/Ma...xpressions.htm
http://www.w3schools.com/Vbscript/func_replace.asp
Reply With Quote
  #5  
Old 08-03-2009, 09:22 AM
abcdetech abcdetech is online now
Registered User
 
Join Date: 04-30-2008
Posts: 18
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 <HintPath> tags.

where %WORK_ROOT% is defined as c:\temp

after implementing your tip I'm getting:

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

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

I'm expecting to see:

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

thank you
Reply With Quote
  #6  
Old 08-03-2009, 09:56 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
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\)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 06:20 PM.


Copyright © 1999-2023 Kinook Software, Inc.