thanks for you responses,
in the meanwhile i wrote a handler myself,
just to not waste time searching.
but i posted the question becuase i asumed there must be much more efficient way to do it, rather than creating repeatloops and walk through all paths.
this can become very time/cpu consuming.
especially with lots of files and long paths


On 23 mei 2005, at 17:51, Irv Kalb wrote:

But the real question is why do you have "hard coded" path names in your program? You can build your paths to be cross platform compatible by using "the last char of the moviePath" as your separator.

i'm not hardcoding filepaths in lingo, and i don't need the paths to be platform-independant within director. what i need, is to get the contents of a folder, built a list with absolute paths to all the files in that folder in unix-style, so they should look like "file:///Users/pietje/..." then i use those paths to tell two another applications (through a server, using xml/xmlSocket) which file it should open. one of these apps is running locally, the other remote on a machine with the exact-same filesystem structure.

a bit hard to explain all details..
i'll tell more about the project later.
it might be interesting to other director developers too.

thanks
arri

On 23 mei 2005, at 17:55, julian weaver wrote:

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!]


[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