1 Reply Latest reply on Feb 10, 2015 2:15 PM by philmodjunk

    Substitute "/" with "\"



      Substitute "/" with "\"


      I have a field that has the path to open a file. I have a button that says to go to that file location.

      I need to be able to go to the file on both a Mac and a PC. On the Mac, the path has "/" separating the directories, but the PC needs to have the slashes reversed: "\". When clicking on the button on the PC, there is no response.

      I tried to create a substitute calculation, but the "\" character is apparently just a blank space after the calculation. How can I get all the / characters reversed to \ in the path so the PC can go there?

      Something that would convert the Mac path to a PC path would be the ideal solution. Seems like that would have been an issue somewhere by now.



        • 1. Re: Substitute "/" with "\"

          \ is an "escape character" inside quoted strings that tell FileMaker "treat the character after me as just another character". It's primarily used to allow developers to get the double quote character into a string ("Text \"quoted\" unquoted" ). so to get the \ into the string, you have to double it:

          Substitute ( YourTextHere ; "/" ; "\\" )

          will thus replace every instance of / with a \.