CreateGuid

This function creates a Globally Unique Identifier (GUID) and returns its string representation, according to the provided format specifier. A GUID is a global 128-bit number and that is an implementation of the Universally Unique Identifier Standards (UUID).

A GUID is typically represented in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX, where X is a placeholder for a hexadecimal character (0-9 or A-F). For example, 936DA01F-9ABD-4D9D-80C7-02AF85C822A8.

SYNTAX
CreateGuid(format) 
ARGUMENTS format

A single-format specifier that indicates how to format the value of this GUID. The format parameter can contain the following specifiers:

  • N: 32 digits

(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)

  • D: 32 digits separated by hyphens

(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

  • B: 32 digits separated by hyphens, enclosed in brackets

{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

  • P: 32 digits separated by hyphens, enclosed in parentheses

(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

  • If format is an empty string (""), "D" is used.

All digits in the return value are hexadecimal. Each character x represents a hexadecimal digit. Each hyphen, bracket, and parenthesis appear as shown.

RETURN The value of this GUID represented as a series of lowercase hexadecimal digits in the specified format.
EXAMPLE
retString = CreateGuid("N")