1. Script object OG.Guid

    Article: AN0002171Updated:

    This object offers functions for work with data type Guid.

    Script functions


    Name Description
    Guid CreateNew() Function returns a new guid.
    Guid Empty Function returns an empty guid.
    bool IsEmpty( Guid guid) Function finds out if the input guid is empty.
    Guid TryParse( string text, string format) Function converts text to guid. If the conversion fails, an empty guid is returned.

    Function TryParse can use following formats "N", "D", "B", "P" or "X". These values correspond to .NET function Guid.TryParseExact (you can get more information in the .NET Framework documentation).

    Object call


    Examples of call

    This call returns a new guid.

    var g = OG.Guid.CreateNew();

    This call converts a text guid into a Guid object.

    var g = OG.Guid.TryParseExact( 'A207E9FD-8994-4EF8-BBB2-9E2393B85E45', 'D');