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 374983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:27:30+00:00 2026-05-12T14:27:30+00:00

I am just wondering if I’m doign something that might be bad, although it

  • 0

I am just wondering if I’m doign something that might be bad, although it seems a very practical solution to me…

I have two forms which the user will have to walk through. The user clicks on a button and form1 pops up. The user presses OK and the second one pops up. The user click OK again and the screens are gone. Or the user clicks on Retry and the screen goes back to the first one. The two screens are completely different sizes with different information.

So I came up with this code:

  Form1 := TForm1.Create(SharedData);
  Form2 := TForm2.Create(SharedData);
  repeat
    ModalResult := Form1.ShowModal;
    if (ModalResult = mrOK) then ModalResult := Form2.ShowModal;
  until (ModalResult <> mrRetry);
  Form1.Release;
  Form2.Release;

I’ve tested this code and it seems to work like a charm. In this code, SharedData is an object that contains data that’s manipulated by both forms. I create this object before the two forms are created and when ModalResult==mrOK I just write the data back to the database.

Problem is, while I think this is a clean solution to handle flipping between two forms, I can’t remember ever seeing something like this construction before. Of course, I’m a Genius. (At least, me Ego tells me I am.) But would there be something against using this piece of code or is it just fine?

  • 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-05-12T14:27:31+00:00Added an answer on May 12, 2026 at 2:27 pm

    If the code does what it’s supposed to, I think it’s fine. I’ve not seen anything quite like it before either, but it’s pretty obvious what it’s doing… which in my book is far better than just blindly following other people’s work. 🙂

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

Sidebar

Related Questions

Just wondering what it is that I am doing wrong here?? It's very simple
Just wondering if anyone knew of any good Calendar libraries for C#? Something that
Just wondering how I do this, Im creating a class that will have my
Just wondering, if I want to create a class that does something and I
Just wondering what little scripts/programs people here have written that helps one with his
just wondering if I have a webpage that generates a pdf, but could take
Just wondering. I have a page in Jquery Mobile which uses a popup that
Just wondering is it possible to build CLI app that can be run from
just wondering is there any chance that their will be a dummy database schemas
Just wondering how Cocos manages the CPU cycle and graphics engine for CCSprites that

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.