IsObjectsIdFormatValid(ObjectIdFormat: String): Boolean;
The IsObjectsIdFormatValid method checks the string on detecting incorrect data (the Russian language, the first character is number, and so on). If the string is correct, it can be used as identifiers format.
The method returns True if the string is correct and False if the string has incorrect data. Incorrect format is not sent to a core and is not used to form objects identifiers.
Identifiers format is determined by the ObjectsIdFormat property.
Executing the example requires a form and components on it: EditBox, Button, Label. The event OnClick is determined for the button.
Class TestForm: Form
EditBox1: EditBox;
Button1: Button;
Label1: Label;
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
MS: IMetabaseSecurity;
MU: IMetabasePolicy;
Begin
MB := MetabaseClass.Active;
MS := MB.Security;
MU := MS.Policy;
If MU.IsObjectsIdFormatValid(EditBox1.Text) Then
Label1.Text := "Correct string";
Else
Label1.Text := "String has incorrect data";
End If;
End Sub Button1OnClick;
End Class TestForm;
After pressing the button a message about correct entry will be displayed on the form.
See also: