OpenURL

This is an old revision of OpenURL, edited by BigChimp at . The current revision is 86069.

/* Description */

Template:Translate

Definition

Unit: Lazarus lclintf

function OpenURL(AURL: String): Boolean;

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

Description

openurl opens an URL with the default/registered web browser as specified by the operating system.

Apparently spaces need to be encoded (as %20); see http://www.ietf.org/rfc/rfc1738.txt

On Windows with Lazarus versions older than development version r40490 (2013-03-06), opening an URL using the file:// URI scheme (to open a local file) may fail if there are spaces in the filename.
With those older Lazarus versions, you should encase the entire string in double quotes - do not escape spaces with %20.
This is unfortunately system and browser dependant. Note: opening URL with spaces will still always on Win9x systems and that cannot be fixed (See bug 21659 in the bugtracker)

Example

uses 
...
lclintf
...
OpenURL('http://wiki.lazarus.freepascal.org/');