PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WINDEV Mobile 24 feature!
  • Properties specific to the description of URI variables
  • Functions that handle URI variables
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
URI (Type of variable)
In french: URI
A URI (Uniform Resource Identifier) variable makes it possible to identify a physical resource (e.g.: a file) or an abstract resource (e.g.: a Web page).
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.).
Example of URI:
Note: See Declaring a variable for more details.
Example
// Open the system window to select an image
UriResource is URI = URISelect(uriImage)
IF NOT ErrorOccurred THEN
// Load the resource
URIToBuffer(UriResource, ProcLoad)
INTERNAL PROCEDURE ProcLoad(bResult, buffer)
IF bResult THEN
// Save the image in the database
HLinkMemo(Client, Photo, buffer)
HModify(Customer)
END
END
END
Remarks

Properties specific to the description of URI variables

The following properties can be used to handle a URI variable:
Property nameType usedEffect
AuthorityCharacter string
  • "Authority" part of the URI,
  • Empty string if not specified.
This property is available in read-only.
PathCharacter stringPath of the URI.
This property is available in read-only.
FragmentCharacter string
  • Fragment of the URI,
  • Empty string if not specified.
This property is available in read-only.
HostCharacter string
  • Host of the URI,
  • Empty string if not specified.
This property is available in read-only.
UserPasswordCharacter string
  • User password,
  • Empty string if not specified.
This property is available in read-only.
PortInteger
  • Port number,
  • 0 if not specified.
This property is available in read-only.
QueryCharacter string
  • Query found in the URI,
  • Empty string if not specified.
This property is available in read-only.
SchemeCharacter stringScheme found in the URI.
This property is available in read-only.
UserCharacter stringUser name.
This property is available in read-only.
ValueCharacter stringComplete URI.

Note: These properties can be handled by using one of the following syntaxes:
  • <Variable name>..<Property name>
  • <Variable name>.<Property name>

Functions that handle URI variables

The following functions handle URI variables:
Versions 24 and later
URIGetInfo
New in version 24
URIGetInfo
URIGetInfo
Retrieves information of a URI resource.
Versions 24 and later
URISelect
New in version 24
URISelect
URISelect
Opens a system window to select a resource coming:
  • from the device file system,
  • from the Cloud (Google Drive, Microsoft OneDrive, etc.)
  • or from one of the content managers installed on the device.
Versions 24 and later
URIToBuffer
New in version 24
URIToBuffer
URIToBuffer
Loads in the background the content of a resource (image, text, etc.) identified by its URI in a buffer variable.
Versions 24 and later
URIToFile
New in version 24
URIToFile
URIToFile
Saves, in the background, the content of a resource (image, text, etc.) identified by its URI in an external file.
To reset the content of a URI variable, you can use VariableReset.
See also
Minimum version required
  • Version 24
Comments
Click [Add] to post a comment