On Jan 27, 2012, at 11:56 AM, Klaus on-rev wrote:
> Hi Pete,
>
> Am 27.01.2012 um 18:35 schrieb Pete:
>
>> Hi Ken,
>> You're saving my life on these Mac/Windows issues, thank you! One question
>> on this. What do the ask/answer file/folder dialogs return on Windows?
>> Does LC convert the "\" chars to "/" before putting it into the it variable,
>
> Yes!
>
>> or just pass whatever the os returns?
>
> No!
>
> :-)
>
> Internally LiveCode always uses the UNIX slash / as the pathdelimiter.
Right - LC tries its hardest to keep things internally compatible and
automatically translates "foreign" things like line breaks and path delimiters
to its own internal format, and then retranslates it back when LC reaches out
to the host operating system. So if you do an "answer file" on Windows and then
get the path to the selected file, it's "/"-delimited, not "\"-delimited. If
you then have to write data out to a file on Windows, and you do something like:
put "Hello" into url ("file:C:/Users/kray/Desktop/Hello.txt")
it will work because LC recognizes it's on Windows and translates that to
"C:\Users\kray\Desktop\Hello.txt" to communicate with the OS.
So the only times we need to deal with path delimiters is when (a) working with
the WIndows registry (see queryRegistry/setRegistry/etc.), and (b) when handing
off paths to external applications (like VBScript or AppleScript), IIRC.
>
Ken Ray
Sons of Thunder Software, Inc.
Email: [email protected]
Web Site: http://www.sonsothunder.com/
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode