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)
-   -   Passing Macro file path to Jscript (https://www.kinook.com/Forum/showthread.php?t=1508)

rich.peters 01-31-2006 04:58 PM

Passing Macro file path to Jscript
 
When I pass a macro such as %PROJDIR% to Jscript, it replaces the backslashes in the file path with trash or nothing

(Presumably treating the \ as a C escape character)

ie :
jscript
--------------
var BuildXMLFile = "%BUILD_XML_FILE%" ;
WScript.Echo("Reading XML file:" + BuildXMLFile);

output
-------------

Reading XML file:C:devR1/buildproject.xml
Unable to Load XML File C:devR1/buildproject.xml: The system cannot find the path specified.

Is there a way to fix this?

thanks
Rich

kinook 01-31-2006 10:30 PM

The trick is to prevent the literal string value from being evaluated by the script engine:

var BuildXMLFile = Application.ExpandMacros(vbld_AllMacros().Item("BUILD_XML_FILE").Value);


All times are GMT -5. The time now is 09:40 AM.


Copyright © 1999-2023 Kinook Software, Inc.