[Lazarus] lclintf.OpenURL parameter: double quotes or not?

Reinier Olislagers reinierolislagers at gmail.com
Fri Apr 6 13:10:52 CEST 2012


Hi all,
(Example on Windows)
OpenURL can be used to open a file on the local machine.

The documentation
http://lazarus-ccr.sourceforge.net/docs/lcl/lclintf/openurl.html

says you need to have a valid URL like file://c:\test\bla.pdf

If I have a path with spaces in it and try and open a pdf file, these
arguments work:
"file://c:\some path with spaces\some file.pdf"
and
c:\some path with spaces\some file.pdf

This one doesn't:
file://c:\some path with spaces\some file.pdf
(It doesn't open the file, but ShellExecuteW that is called in OpenURL
does return a success result code)

Should the file:// URL be surrounded by double quotes? This seems
strange as e.g. FileExists and FilexistsUTF8 don't require double quotes.
If so, I think the documentation should mention it...

Will double quoting work on other platforms?

See this discussion
http://lazarus.freepascal.org/index.php/topic,16512.0.html
on the forum.

Thanks,
Reinier




More information about the Lazarus mailing list