Forum Discussion

mminnder's avatar
mminnder
Occasional Contributor
11 years ago

Text Streams and Troubles

So, I'm currently making a program that checks a json returned from a web service against a local json, and if the local doesn't exist, than it should create it using the return. When I do this I want...
  • Philip_Baird's avatar
    11 years ago
    Hi Mike, no, you do not have to replace the single "\" s returned by Project.Path



    JScript uses the "\" character to escape special characters in a literal string, e.g. \t (tab) and \r (carriage return), therefore, "\\" is simply the escape sequence for "\"



    E.g. the literal string "C:\\MyFiles\\DemoFile.txt" evaluates to "C:\MyFiles\DemoFile.txt"



    For the case with Project.Path as it not a literal string, the escape sequence is not required, e.g. 



    Project.Path + "\\
    JSON\\Returns\\test.txt" would evaluate to



    "C:\Users\Phil\Documents\TestComplete 9 Projects\TestProject1\JSON\Returns\test.txt"



    depending.of course, the actual path to the Project



    Phil