Cancel
Showing results for 
Search instead for 
Did you mean: 

Message box value

Creator
Creator

Hello all,

 

I'm trying to open a frame by selecting yes in the messagebox. The book "Manufacturing simulation with plant simulation" states the following:

If the user clicks one of the buttons, the method messagebox returns one of the following values:

• OK 1

• Cancel 2

• Yes  16

• No  32

 

My method:
is
input:string;
pass:string;
do
messageBox("hello", 48, 0)

????
.models.model.Frame.openDialog; 
end;

 

My question is how I can read those values that the messagebox should return?  My if then, when, and inspect methods did not work Smiley Sad

 

Thank you in advance!

2 REPLIES

Re: Message box value

Valued Contributor
Valued Contributor

Hello @Simulator2

the code should be like this:

is
    input:string;
    pass:string;
do
    if messageBox("hello", 48, 0) = 16 then
        .models.model.Frame.openDialog;
    end;
end;

 

The value you're looking for is returned by the messageBox function, and the number corresponds to the list you posted above.

You can also store the value in a variable:

local retValue : integer := messageBox("hello", 48, 0);

 

Hope this help you.

Regards,

 

BD

99 little bugs in the code,
99 little bugs in the code.
Take one down, patch it around.
127 little bugs in the code...

Re: Message box value

Creator
Creator

It always seems so easy when somebody explains it. Thanks for your quick response!