Re: RadioButton - Making a choice and continuing

Posted by Lionel Joyner on February 28, 2006

In Reply to Re: RadioButton - Making a choice and continuing posted by webmaster Guido on February 28, 2006

: Mmmm, seems I was only giving the user a few microseconds to click a radiobutton ;-)
: But this time :-p I actually tested the code with a small test program:
: procedure TForm1.Button1Click(Sender: TObject);
: var
: StartTickCount: DWORD;
: begin
: // ...
: while (not RadioButton1.Checked) and
: (not RadioButton2.Checked) do begin
: ShowMessage('You forgot to check your selection');
: // As long as no radiobutton is checked,
: // repeat the message every 5000 milliseconds
: StartTickCount := GetTickCount;
: while (not RadioButton1.Checked) and
: (not RadioButton2.Checked) and
: (GetTickCount < StartTickCount + 5000) do
: Application.ProcessMessages;
: end;
: // if RadioButton1.Checked ...
: // and so on...
: end;

Happy days are here again--Thank You!
I also made up a small test program using the part of my application where I needed the RadioButton Choice and it worked so good that I can't believe it. (-: --- This has been a very good code experience for me Guido and I was close to getting it but it took your skills to put it right, so thanks again.