944,168 Members | Top Members by Rank

Ad:
Aug 21st, 2005
0

Gettig delphi to wait for a button press before continuing

Expand Post »
Hi

I am currently writing a program where it gets to a point where it has to ask a question. I have created a group box which pops up, asking the question and giving a yes/no choice. the onclick event of the "yes" button sets a bool to true and the onclick of button "no" event sets the bool to false. The bool is set to false be default

The problem I have is that the program skips straight past the option of the bool being true as it doesnt give the user a chance to click a button. Is there a way that I can tell delphi to wait till either the yes or no button is pressed. Even a function that is already built into delphi 2005 would do the job, but it would need to have only yes/no buttons to respond.

Any ideas?

Thanks

Sean Bedford
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sbedford is offline Offline
18 posts
since Jul 2005
Aug 22nd, 2005
0

Re: Gettig delphi to wait for a button press before continuing

seems like u are using one big procedure that include most of the program, right? that wolud be the troble. ur code must stop when u have to choose beetween yes and no. in yes.OnClick u write ur code for yes and in no.OnClick u write the code for no.... not just bool=true/false. programing in delphi is differet from pascal...
i hope i understood right ur problem and i gaved a right answer...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Tepes is offline Offline
6 posts
since Aug 2005
Aug 22nd, 2005
0

Re: Gettig delphi to wait for a button press before continuing

yeah, it is all part of 1 big procedure. What I am doing is like a supermarket till system. This question is for age checking, like alcohol etc, the question asks if the customer is old enough. The question is only brought up if the age restriction on the item is > than the currently logged customer age (gotten from asking the question before). This means that the question must come up in the procedure of adding the item to the bill, as each item could have a different age restriction on it. So I dont think its possible to seperate it out into the yes/no button code
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sbedford is offline Offline
18 posts
since Jul 2005
Aug 24th, 2005
0

Re: Gettig delphi to wait for a button press before continuing

than u need a nother button in the end of the list of the questions. so the user will press that button after answering all the questions. u contionue the code in that button. u will not a boolean variable for each question...or an integer variable that could be -1 initial and 0/1 after user will answer the question(so u can check if the user answered that question or skip it)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Tepes is offline Offline
6 posts
since Aug 2005
Aug 24th, 2005
0

Re: Gettig delphi to wait for a button press before continuing

Ok I got it going now - theres a function called messagedlg, which can be used to ask a question and display a yes/no option
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sbedford is offline Offline
18 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Help with delphi project
Next Thread in Pascal and Delphi Forum Timeline: Packets sending...





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC