|
|
|
|
|
- Properties specific to URI variables
- Functions that manipulate URI variables
URI (Type of variable) In french: URI
The URI (Uniform Resource Identifier) type identifies physical or abstract resources (e.g. files or Web pages). There are two types of URIs: - URLs (Uniform Resource Locator): identify a resource through its location and the means to access it.
Examples: - Web address: https://www.windev.com/windevmobile/index.html
- Location of a file on disk: file:///C:/Users/johndoe/Documents/log.txt
- URNs (Uniform Resource Name): identify a resource by its name. They do not make it possible to locate the resource but must remain unique and persist even if the resource no longer exists or becomes unavailable.
Example: ISBN number: urn:isbn:0-395-36341-1
A URI can be represented as a character string whose syntax complies with the standard defined by RFC 3986. Each URI can contain up to five parts: <scheme>: [//<authority>]<path>[? <query>] [ # <fragment> ] - The URI scheme is a letter followed by any combination of letters, numbers, plus sign (+), period (.) or dash (-) and ends with a colon (:). In the case of a URL, it generally corresponds to the protocol to be used to access the resource: http, https, ftp, etc.
- The authority of the URI is an optional part that corresponds to the identification information to access the resource. Its format is usually:
[<user>[:<password>]]host[:<port>] - The path is a sequence of segments separated by slashes (/). In the case of a URL on a Web page for example, it represents the path to the resource on the host.
- The request is an optional part preceded by a? and followed by a set of pairs ' key=value' separated by '&'. In the case of a URL on a web page for example, it allows you to pass named parameters to the page.
- The fragment is an optional part preceded by a '#' that allows providing additional information to access a secondary resource (page number, anchor of an HTML page, etc.).
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable. Remarks Properties specific to URI variables The following properties can be used to handle a URI variable: | | | Property name | Type used | Effect |
---|
Authority | Character string | - "Authority" part of the URI,
- Empty string if not specified.
This property is available in read and write mode. | Fragment | Character string | - Fragment of the URI,
- Empty string if not specified.
This property is available in read and write mode. | Host | Character string | - Host of the URI,
- Empty string if not specified.
This property is available in read and write mode.Caution: If the Host property is modified: - the User and Password properties are reset: you need to assign a value to these two properties.
- the Port property is reset: a value has to be assigned to the Port property as well.
| Path | Character string | Path of the URI. This property is available in read and write mode. | Port | Integer | - Port number (between 1 and 65365),
- 0 if not specified.
This property is available in read and write mode. | Query | Character string | - Query found in the URI,
- Empty string if not specified.
This property is available in read and write mode. | Scheme | Character string | Scheme found in the URI. If changes are made, this property is mandatory and cannot be empty. This property is available in read and write mode. | User | Character string | Username. This property is available in read and write mode. | UserPassword | Character string | - User password,
- Empty string if not specified.
This property is available in read and write mode. | Value | Character string | Complete URI. |
You can use VariableReset to reset the contents of a variable of type URI. Functions that manipulate URI variables The following functions handle URI variables:
| | BufferToURI | Saves the contents of a buffer to a resource identified by its URI. | FileToURI | Saves the contents of a file to a resource identified by its URI. | URIGetInfo | Retrieves information of a URI resource. | URISelect | Opens a system window to select a resource from: - from the device file system,
- from the Cloud (Google Drive, Microsoft OneDrive, etc.)
- or from one of the content managers installed on the device.
| URIToBuffer | Loads in the background the content of a resource (image, text, etc.) identified by its URI in a buffer variable. | URIToFile | Saves, in the background, the content of a resource (image, text, etc.) identified by its URI in an external file. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|