Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • local path and double quotes in mac and PC

    Hi,

    I want to remove all the backslash from a list of programx in order to make them readable by both mac and pc. I have an issue that I have solved but I don't understand why. A simple example would be:

    program drop stupid_test
    program define stupid_test
    syntax using
    if mi("`using'")==0 {
    dis "****"
    dis "working"
    dis "****"
    }
    end

    This program works for a typical PC path:
    stupid_test using "C:\Users\abouguen\x"

    But not for a mac:
    stupid_test using "C:/Users/abouguen/x"


    Now using compound quotes,

    program drop stupid_test
    program define stupid_test
    syntax using
    if mi(`"`using'"')==0 {
    dis "****"
    dis "working"
    dis "****"
    }

    end

    stupid_test using "C:\Users\abouguen\x"
    stupid_test using "C:/Users/abouguen/x"

    Both work. Why slash would require compounds quotes but not back slash ?

    I am confused

    Thanks
Working...
X