Skip to main content

[Migrated content. Thread originally posted on 16 May 2012]

In adding other dialogs to my initial form group for questions & things I have code in my main form that reads as follows...

* The DELETE button gets pressed.
*//////////////////////////////////////////////////////////////////////////////
method-id DelButton_Click final private.
local-storage section.

01 Result type DialogResult.
01 MessageDialog type BankSetup.ConfirmMessage.

procedure division using by value sender as object e as type System.EventArgs.

set MessageDialog to new BankSetup.ConfirmMessage
invoke MessageDialog::ShowDialog() RETURNING Result


My question is how do I check the value of RESULT?

Have tried...

if MessageDialog::DialogResult = Result::OK but I get an error stating that 'Could not find method OK with this signature'.

Have looked all over the msdn stuff and it says that OK at the end should work. What am I missing?


[Migrated content. Thread originally posted on 16 May 2012]

In adding other dialogs to my initial form group for questions & things I have code in my main form that reads as follows...

* The DELETE button gets pressed.
*//////////////////////////////////////////////////////////////////////////////
method-id DelButton_Click final private.
local-storage section.

01 Result type DialogResult.
01 MessageDialog type BankSetup.ConfirmMessage.

procedure division using by value sender as object e as type System.EventArgs.

set MessageDialog to new BankSetup.ConfirmMessage
invoke MessageDialog::ShowDialog() RETURNING Result


My question is how do I check the value of RESULT?

Have tried...

if MessageDialog::DialogResult = Result::OK but I get an error stating that 'Could not find method OK with this signature'.

Have looked all over the msdn stuff and it says that OK at the end should work. What am I missing?


Hi,

You should be able to check the result using the DialogResult enumeration:-


       01  myForm      type TestDialogBox.Form2.
       01  myResult    type System.Windows.Forms.DialogResult.
       
       
           set myForm to new TestDialogBox.Form2
           
           invoke myForm::ShowDialog() returning myResult
           if myResult = type System.Windows.Forms.DialogResult::OK
               display "OK"
           end-if
           if myResult = type System.Windows.Forms.DialogResult::Cancel
               display "Cancel"
           end-if

Regards
David

[Migrated content. Thread originally posted on 16 May 2012]

In adding other dialogs to my initial form group for questions & things I have code in my main form that reads as follows...

* The DELETE button gets pressed.
*//////////////////////////////////////////////////////////////////////////////
method-id DelButton_Click final private.
local-storage section.

01 Result type DialogResult.
01 MessageDialog type BankSetup.ConfirmMessage.

procedure division using by value sender as object e as type System.EventArgs.

set MessageDialog to new BankSetup.ConfirmMessage
invoke MessageDialog::ShowDialog() RETURNING Result


My question is how do I check the value of RESULT?

Have tried...

if MessageDialog::DialogResult = Result::OK but I get an error stating that 'Could not find method OK with this signature'.

Have looked all over the msdn stuff and it says that OK at the end should work. What am I missing?


Much appreciated.