Constructors: NewGuid |
Initializes a new instance of the Guid object by using the specified array of bytes, string, or memory pointer.
Public Function NewGuid( ByRef Value As Variant ) As Guid
A new Guid can be initialized from a specified array of bytes, string, or memory pointer.
Data Type | Description |
---|---|
String |
A string that contains a GUID in one of the following formats ("d" represents a hexadecimal digit whose case is ignored): 32 contiguous Digits: dddddddddddddddddddddddddddddddd -or- Groups of 8, 4, 4, 4, and 12 digits with hyphens between the groups. The entire GUID can optionally be enclosed in matching braces or parentheses: dddddddd -dddd - dddd - dddd - dddddddddddd -or- {dddddddd-dddd-dddd-dddd-dddddddddddd} -or- (dddddddd-dddd-dddd-dddd-dddddddddddd) -or- Groups of 8, 4, and 4 digits, and a subset of eight groups of 2 digits, with each group prefixed by "0x" or "0X", and separated by commas. The entire GUID, as well as the subset, is enclosed in matching braces: {0xdddddddd, 0xdddd, 0xdddd,{0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd}} All braces, commas, and "0x" prefixes are required. All embedded spaces are ignored. All leading zeros in a group are ignored. |
Byte Array | A 16-element byte array containing values with which to initialize the GUID. |
Long | A pointer to a memory location to read 16 consecutive bytes with which to initialize the GUID. |
Exception | Condition |
---|---|
ArgumentNullException | byte array is null. |
ArgumentException | byte array is not 16 bytes long. |
FormatException | string format is invalid. |