GenerateId(Value: String; [Namespace_: Integer = 0]): String;
Value. Required identifier.
Namespace. Key of the object-container, within which namespace the identifier is generated.
The GenerateId method generates a unique identifier within the current repository.
If the current repository does not have the object, which identifier matches the value of the Value parameter, the method results in the value of the Value parameter.
If the object already exists, the method results in the changed value of the Value parameter, that is: numbers (from 1 to 28726) are kept adding to the end of the string until the result is unique. If one failed to get such an identifier, the method returns an empty string.
The Value parameter value | (An) identifier(s), existing in the repository | The result of method execution |
Ident | - | Ident |
Ident | Ident | Ident1 |
Ident | Ident Ident1 Ident2 |
Ident11 |
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
s: String;
Begin
MB := MetabaseClass.Active;
s := MB.GenerateId("obj123");
End Sub UserProc;
After executing the example the "s" variable stores the generated identifier.
See also: