here's a version I wrote for mac - just add your prefixes for windows

on replacePathForUnix me, trackpath

replaceDelim = "/"

  if the environment.platform contains "Macintosh" then
    myPrefix = "/Volumes/"
    findDelim = ":"
else
--// windows
        myprefix = ""
        findDelim = "\"
end if

    repeat while offset(findDelim, trackpath) > 0
      replaceChar = offset(findDelim, trackpath)
      put replacedelim into char replaceChar of trackpath
    end repeat

    return myPrefix&trackpath
end


On 23 May 2005, at 16:28, arjen wrote:

hi

this must be so easy, but i can't find the answer anywhere;

howto replace all occurences of a character in a string with another character?

the time i wasted with searching i could have also spent with making a handler that does that, but there must be a much faster way of doing it than looping through all chracters in the string,
test to see if it needs to be replaced?

actually i'm looking for a way to convert mac or pc paths into unix-style paths,
so instead of "HD:Users:pietje .." i want "/Users/pietje/.."
is there maybe a function to do that?


arri

[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [email protected] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[email protected]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to