Home > Language Reference > Functions > Strings
BuildURL Function
Builds an URL from a base address, a path and a filename.
Syntax
Public Function BuildURL(ByRef sBaseURL As String, ByRef sRelativeURL As String) As String
| Parameter | Description |
| sBaseURL | Base address. |
| sRelativeURL | Path and file name. |
Remarks
The BuildURL function builds a full URL from a base address, a relative path and a filename. It does not check however that each of these parameters is valid; if the base URL is malformed for example, the returned URL will be malformed as well.
The sBaseURL parameter is the base URL. Usually it will contain a protocol, a domain name and possibly a path. For example, it could be "http://www.handheld-basic/forum". The sRelativeURL is the relative path and file name to append to the base URL. Special character sequences such as "./" or "../" are properly interpreted.
For example:
Private Sub Button1_Click()
MsgBox BuildUrl("http://www.handheld-basic.com","index.php")
MsgBox BuildUrl("http://www.handheld-basic.com","/index.php")
MsgBox BuildUrl("http://www.handheld-basic.com/forum","../index.php")
End SubAll these calls will display the same string, namely "http://www.handheld-basic.com/index.php".
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | N/A |