ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage syntax / WLanguage types
  • Empty UUID
  • Possible conversions
  • Available operations
  • Comparison
  • Generating a UUID
  • HFSQL items
  • Management of UUID types in controls
  • COM interface
  • Serialization
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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:
  • on 128 bits. 128-bit UUIDs comply with RFC 4122.
  • on 256 bits.
UUID is a nullable type. For more details, see Allowing nullable types.
Example
v is UUID 	// Declaration of a 128-bit UUID by default
v1 is UUID on 128
v2 is UUID on 256
Syntax

Declaring and assigning a UUID type 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 that will be assigned to the variable. A UUID variable can be assigned with:
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.

Possible conversions

The main purpose of conversions is to allow easy debugging while detecting operations that make no sense. Conversions into string or buffer are possible, but it is not possible to make a conversion into a numeric variable.
A 128-bit UUID can be converted into:
  • standard hexadecimal string "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".
  • "big-endian" buffer (16 bits).
A 256-bit UUID can be converted into:
  • hexadecimal string "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".
  • "big-endian" buffer (32 bits).
Other conversions are not allowed. Especially, a 128-bit UUID cannot be converted into 256-bit UUID and vice versa.

Available operations

The main purpose of operations is to allow easy debugging while detecting operations that make no sense. Concatenation with a string 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.

Management of UUID types in controls

"UUID" and "UUID 256" input and display masks are available for the controls that allow handling these types.
Binding to HFSQL items and UUID variables is possible.

COM interface

A 128-bit UUID can be used to store CLSIDs and IIDs from COM objects and interfaces. It can therefore be used in COMCreateInstance and COMQueryInterface.

Serialization

UUIDs can be serialized (Serialize):
  • UUID 128:
    • Serializable in XML and JSON: standard string: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    • Serializable in binary: "big-endian" binary format.
  • UUID 256:
    • Serializable in XML and JSON: string: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    • 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: 03/15/2024

Send a report | Local help