IMetabase.GenerateId

Syntax

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

GenerateId(Value: string; Namespace_: uinteger): string;

Parameters

Value. Required identifier.

Namespace. 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 Value input parameter is a required 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

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;
Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    s: String;
Begin
    MB := Params.Metabase;
    s := MB.GenerateId("obj123"0);
End Sub;

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

See also:

IMetabase