編集

次の方法で共有


Enum.FromInteger(Integer) Method

Version: Available or changed with runtime version 4.0.

Returns an enum with the integer value

Syntax

Enum with integer value :=   Enum.FromInteger(Value: Integer)

Parameters

Value
 Type: Integer

Return Value

Enum with integer value
 Type: Any

Example

enum 50130 YesNo
{
    value(0; Yes) { }
    value(10; No) { }
}

codeunit 50130 YesNoTest
{
    procedure Test()
    var
        Answer: enum YesNo;
    begin
        Answer := Enum::YesNo.FromInteger(10); // Ordinal value for 'No'
        if Answer = YesNo::No then
            Message('Success');
    end;
}

Enum Data Type
Get Started with AL
Developing Extensions