Skip to main content

IsEmptyGuid

Function IsEmptyGuid(const aGuid: TGuid): Boolean

Example

procedure ScriptEvent(var Value: variant);
var
Identifier: TGuid;
begin
Identifier := SafeStringToGuid('');
Value := IsEmptyGuid(Identifier); // True
end;

Usage

IsEmptyGuid tests whether all fields of a TGuid equal GUID_NULL.

Parameters

NameTypeDescription
aGuidTGuid, constBinary 16-byte GUID value to compare.

Returns

True when all fields equal GUID_NULL; otherwise False.

Important usage notes

  • Any single nonzero bit makes the result False; GUID version/variant validity is irrelevant.
  • The function does not recognize empty text, whitespace, SQL null or variant null because its parameter is already a TGuid record.
  • A parsed or generated zero GUID is indistinguishable from the deliberate sentinel.
  • String casing and braces do not matter after successful parsing because the comparison is binary.

Additional Technical Info

IsEmptyGuid returns True only when a TGuid record is exactly equal to the all-zero GUID_NULL value. It compares the binary value, not a string representation.

The example is fictional, deterministic, source-reviewed and was not executed by the documentation workflow.

Implementation

The direct runtime pointer calls vxCommon.IsEmptyGuid, which returns IsEqualGuid(aGuid, GUID_NULL). Installed Delphi implements IsEqualGUID as record equality (Guid1 = Guid2), so all 128 bits participate.

Side effects and errors

None. No allocation, operating-system call or expected exception.

Performance and concurrency

Constant-time fixed-record comparison with no shared mutable state.

Related entries

External references

Created 2026-07-15