1 Reply Latest reply on May 27, 2015 11:49 AM by philmodjunk

    Change BackSlash to ForwardSlash



      Change BackSlash to ForwardSlash


      Need to convert a Windows path string to one that the FM web viewer can read.  To do that I need to convert the backslashes in the Windows path to forward slashes.  So:

      ReplaceFieldContents[fieldname] and chose the Replace with calculated result which I took to be something like:

      Replace( "\"; 1; 1; "/" ).  When trying to accept this entry, the error displayed is "The text constant does not end with a quotation mark."  Where did I go wrong, please?

      Thanks very much.

        • 1. Re: Change BackSlash to ForwardSlash

          The backslash is used as the "escape character" in quoted strings. It tells FileMaker: "use the very next character as just a character, not the character to end a quoted string.

          so "\"  is evaluated as the start of a quoted string, (first quote) that contains a double quote character (backslash quote) and then you get  an error because no quote is found to end the string. To get a backslash, you can escape it with another backslash

          "\\" will evaluate as a single backslash character .

          But I think that your calcuation to use in Replace Field Contents--which will modify every record in your found set BTW--is this expression:

          Substitute ( YourTable::YourField ; "\\" ; "/' )

          You can also build this calculation directly into your Web Viewer instead of doing a replace on your table.