GetGUID
(Engine-Level Function)
Description: |
Creates a globally unique identifier or converts an existing GUID between the binary format used by most RPC functions and the text format used otherwise.
|
Returns: |
Text |
Usage: |
Script only. |
Function Groups: |
Network |
Related to: |
|
Format: |
GetGUID(Format [, ExistingGUID]) |
Parameters: |
|
Format |
Required numeric. Defines the format of the return value as followsFormat | Format definition |
---|
0 | 36 byte text string | 1 | 16 byte binary string |
|
ExistingGUID |
An optional parameter that is any text expression for the GUID to be converted from one format to another. No default value. |
Comments: |
Any generated GUID will be different from all others generated on this or any other machine now or in the future. It is particularly useful in generating unique variable or file names.
The current application's GUID is stored in \LocalGUID, using the 16-byte binary form. To use this in a function that requires the GUID in text format, use: GetGUID(0, \LocalGUID);
|
Example 1:
The following script will cause GUID1 to be set to a globally unique 16 bit binary string and GUID2 to convert GUID1 to its 36 byte ASCII string equivalent.
If 1 Main;
[
GUID1 = GetGUID(1);
GUID2 = GetGUID(0, GUID1);
]
Example 2:
Obtain the current application's existing GUID as a 32-character string.
If 1 Main;
[
MyGUID = GetGUID(0,\LocalGUID);
]
Trihedral and VTScada are registered trade marks of Trihedral Engineering Limited
© Trihedral Engineering Limited 1983- 2024 All rights reserved.