Previous Topic

Next Topic

URLEncode - MaxBasic Function

URLEncode(URLText: String[, URLProtocol: String]): String

Given a string containing a URL, returns URL with percent encoded reserved characters.

Protocol can optionally be passed as a second parameter, default if not included in URL and not passed explicitly is "HTTP".

URLEncode function syntax has these named arguments:

Parameter

Description

URLText

Required. String to encode with percent encoded reserved characters.

URLProtocol.

Optional. The protocol to use, defaults to "HTTP".

Sample code:

  MyUrl = "www.example.com/index.html?param=1 &anotherParam=2"
  MyURL = URLEncode(MyURL)
  print MyURL

Returns: http://www.example.com/index.html?param=1%20&anotherParam=2

See Also

Web Functions

Book Contents

Book Index