IMetabase.GenerateId

Syntax

GenerateId(Value: String; [Namespace_: Integer = 0]): String;

Parameters

Value - a desired identifier.

Namespace_ - a key of the object-container, within which namespace the identifier is generated.

Description

The GenerateId method generates a unique identifier within current metadata base (repository). The input parameter - Value - is a desired identifier.

In case if the current repository has no object, which identifier coincides with a value of the Value parameter, the result of method functioning will be the value that coincides right with the values of the Value input parameter.

If the object already exists, the result contains a changed value of the Value parameter, particularly: a number (from 1 to 28726) is added to the end of original line, until the result becomes unique. In case if such identifier wasn't obtained, the method returns an empty line.

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

Example

Sub Main;

Var

MB: IMetabase;

s: String;

Begin

MB := MetabaseClass.Active;

s := MB.GenerateId("obj123");

End Sub Main;

After executing the example the "s" variable stores the generated identifier.

See also:

IMetabase