Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Help with an Exit code in Delphi Posted by mundim on 29 Jan 2012 at 10:55 AM
Hi, I'm making a very simple program with check boxes and I want to the program to instantly close when the right combination of checkboxes are selected.

I tried using a code like that, using the property "checked"...

If Checkbox1.Checked := True and Checkbox5.Checked := True and Checkbox10.Checked := True and Checkbox12.Checked := True and Checkbox15.Checked := True then Exit;

But it's not working... It reject all the coding...

Please help me...
Report
Re: Help with an Exit code in Delphi Posted by mundim on 29 Jan 2012 at 10:59 AM
Sorry for double topic, they said an error had happenned so I tried again...
Report
Re: Help with an Exit code in Delphi Posted by EitanArbel on 28 Feb 2012 at 9:40 AM

well, here are a few words about Exit, from the Delphi help:
"Exits from the current procedure.
...
If the current procedure is the main program, Exit causes the program to terminate."

so in order to close the program, you should use the "Close" command,
or use "Application.Terminate".


and to make your "If" a little better:
If (Checkbox1.Checked) and (Checkbox5.Checked) and (Checkbox10.Checked) and (Checkbox12.Checked) and (Checkbox15.Checked) then Close;

or "then Application.Terminate;".

you dont have to ask if it's True

(sorry for my broken english)
Report
Help with an Exit code in Delphi Posted by karanchanana75 on 2 Apr 2012 at 3:43 AM
The Exit code variable is the code returned by a terminating application to the invoker.The exit code value will be displayed in a dialog box if the error addr variable is non 0 when the program terminates.


Amira Foods (India) Ltd - Karan Chanana




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.