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)
-   -   Replace in File: disabling vbscript parser for search / replace expressions? (https://www.kinook.com/Forum/showthread.php?t=4911)

Rogier 09-20-2011 09:53 AM

Replace in File: disabling vbscript parser for search / replace expressions?
 
I want to replace some string within file A with the contents of another file B, using the "Replace in File" step.

To do so, I've entered this as the 'replace' contents:

Quote:

[vbld_FSO.OpenTextFile("FileB").ReadAll]
Problem: when file B (which is to be inserted into A) contains stuff between square brackets [like this], I'm getting random "invalid expression" errors - apparently the vbscript parser interprets the result of the above expression as well. I've already enabled "Tread all characters as literals (no regexp)", that didn't solve it.

Is there a way to literally get a file's contents as search or replace pattern, and have VBP use that without parsing that content for vbscript? And I guess same goes for stuff %between percentage marks% because that would be interpreted as a macro.

Basically I'm looking for a way to insert a file "binary", without any parsing whatsoever. Suggestions?

kinook 09-20-2011 12:16 PM

See the vbld_GetFileContents system script function or vbld_EscapeString.
http://www.kinook.com/VisBuildPro/Ma...scriptfile.htm
http://www.kinook.com/VisBuildPro/Ma...scriptmisc.htm

Rogier 09-20-2011 03:22 PM

Excellent, thanks!


All times are GMT -5. The time now is 04:06 AM.


Copyright © 1999-2023 Kinook Software, Inc.