Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8259453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:52:04+00:00 2026-06-08T02:52:04+00:00

Trying to get a custom dialogbox to work with the button names weapon1 ,

  • 0

Trying to get a custom dialogbox to work with the button names weapon1 , weapon2, and cancel. But with this code it is giving error on Result as undefined when i try to compile it
The error message is

[DCC Error] ssClientHost.pas(760): E2003 Undeclared identifier: ‘Result’

The code is :

      with CreateMessageDialog('Pick What Weapon', mtConfirmation,mbYesNoCancel) do
       try
           TButton(FindComponent('Yes')).Caption := Weapon1;
           TButton(FindComponent('No')).Caption := Weapon2;
           Position := poScreenCenter;
           Result := ShowModal;
        finally
     Free;
   end;
     if buttonSelected = mrYes    then ShowMessage('Weapon 1 pressed');
     if buttonSelected = mrAll    then ShowMessage('Weapon 2 pressed');
     if buttonSelected = mrCancel then ShowMessage('Cancel pressed');
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:52:05+00:00Added an answer on June 8, 2026 at 2:52 am

    The code posted above has a lot of errors, unless there are parts you are not showing us. For one thing, if there are no string variables Weapon1 and Weapon2, then you cannot refer to such variables! Second, if there is no Result variable (there is if the code is inside a function, for instance), then that’s an error, too. Also, in your code above, buttonSelected is a variable, which you might have forgotten to declare as well. Finally, first you talk about Yes and No, then you talk about Yes and Yes to all.

    The following code works (standalone):

    with CreateMessageDialog('Please pick a weapon:', mtConfirmation, mbYesNoCancel) do
      try
        TButton(FindComponent('Yes')).Caption := 'Weapon1';
        TButton(FindComponent('No')).Caption := 'Weapon2';
        case ShowModal of
          mrYes: ShowMessage('Weapon 1 selected.');
          mrNo: ShowMessage('Weapon 2 selected.');
          mrCancel: ShowMessage('Cancel pressed.')
        end;
    finally
      Free;
    end;
    

    Disclaimer: The author of this answer is not fond of weapons.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get custom relationship names to work in Mongo. A collage is
I'm trying to get custom namespaced events to work as described here: http://docs.jquery.com/Namespaced_Events But
I'm trying to get a custom template tag to work but am having some
I am trying to get my custom CREATEUSER to work but I think I'm
Trying to get this custom pager to work for jQuery Cycle. I want the
I'm trying to get my custom validation to work on create . But when
Im trying to get a custom menu to show when the menu button is
I'm trying to get a custom handler to work for a specific URL (or
I'm trying to create a custom property for my web part, but can't get
I am trying to get the custom dialog to close on button press //set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.