ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage syntax / WLanguage types
  • Empty UUID
  • UUID format
  • Possible conversions
  • Available operations
  • Comparison
  • Generating a UUID
  • HFSQL items
  • Using UUID types in controls
  • COM interface
  • Serialization
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The UUID type is used to easily manage:
  • UUIDs or GUIDs,
  • automatic UUID HFSQL identifiers,
  • identifiers for COM/Automation objects and interfaces
  • etc.
UUID variables are available:
  • as 128-bit values. 128-bit UUIDs comply with RFC 4122.
  • as 256-bit values.
The UUID type supports null values. For more details, see Allowing nullable types.
Example
v is UUID 	// Declaration of a 128-bit UUID by default
v1 is 128-bit UUID
v2 is 256-bit UUID
Syntax

Declaring and assigning a value to a UUID variable Hide the details

<Variable name> is UUID = <Value>

OR


 <Variable name> is UUID
 <Variable name> = <Value>
<Variable name>:
Name of the variable to declare.
<Value>:
Value to be assigned to the variable. The following values can be assigned to a UUID variable:
Remarks

Empty UUID

By default, a UUID variable is empty when it is created. Its value corresponds:
  • to the constant Nil_UUID for 128-bit UUID variables.
  • to the constant Nil_UUID256 for 256-bit UUID variables.

UUID format

The UUIDs recognized by WLanguage are:
  • The official format specified in RFC 9562: "8-4-4-4-12"
  • The usual "{8-4-4-12}" (Microsoft notation) and "32" (monobloc) formats.

Possible conversions

The main purpose of the conversions is to facilitate debugging and detect unnecessary operations. Values can be converted to strings or buffers, but not to numeric variables.
A 128-bit UUID can be converted to:
  • a standard hexadecimal string, e.g. "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".
  • a "big-endian" buffer (16 bytes).
A 256-bit UUID can be converted to:
  • a hexadecimal string, e.g. "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".
  • a "big-endian" buffer (32 bytes).
Other conversions are not allowed. For example, a 128-bit UUID cannot be converted to a 256-bit UUID and vice versa.

Available operations

The main purpose of the operations is to facilitate debugging and detect unnecessary operations. String concatenation is allowed, but arithmetic operations are not.
A UUID (128-bit or 256-bit) can be concatenated with a string or a buffer.

Comparison

UUIDs can be compared to allow for sorting and binary search in an array.
  • 128-bit UUIDs can be compared to 128-bit UUIDs, strings and buffers.
  • 256-bit UUIDs can be compared to 256-bit UUIDs, strings and buffers.

Generating a UUID

A 128-bit UUID can be generated:
  • with the GetGUID function. Example:
    v is UUID = GetGUID()
  • with the GetUUID function. Example:
    v is UUID = GetUUID()
A 256-bit UUID can be generated:
  • with the GetGUID function. Example:
    v is UUID on 256 = GetGUID(guidRough256)
  • with the GetUUID256 function. Example:
    v is UUID on 256 = GetUUID256()

HFSQL items

  • 128-bit and 256-bit UUID items are available in the analysis.
  • 128-bit and 256-bit UUID items can be automatic. In this case, they are automatic UUIDs. A UUID will be automatically generated when HAdd is called.

Using UUID types in controls

"UUID" and "256-bit UUID" input and display masks are available for controls that allow these types.
Data binding to HFSQL items and UUID variables is allowed.

COM interface

A 128-bit UUID can be used to store CLSIDs and IIDs from COM objects and interfaces. Therefore, it can be used with COMCreateInstance and COMQueryInterface.

Serialization

UUIDs can be serialized (Serialize):
  • 128-bit UUID:
    • Serializable in XML and JSON: string in standard "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" format
    • Serializable in binary: "big-endian" binary format.
  • 256-bit UUID:
    • Serializable in XML and JSON: string in "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" format
    • Serializable in binary: "big-endian" binary format.
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 02/12/2025

Send a report | Local help