Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing a program to EXIT

Status
Not open for further replies.

PaulaD

Programmer
Oct 16, 2002
2
CA
I have a user log-on for the application I am writing. I would like to force the application to exit if the log-on is incorrect. The user can press the log-on button at any point in the program, so there can be many screens open & also different tables open. I know I can use HALT, but that doesn't do a proper close, to save & close any open data tables. Is there a simple way to force Clarion to close all open tables/files and then exit?

I am using Clarion 5.5.

 
EVENT:CloseDown will cause the application to shut down orderly. I believe you need to post it to the thread that has the Main Frame is under. (I am not sure what will happen if you simply do a
Code:
Post(EVENT:CloseDown)
in the current thread.)
 
This the method I use
On the main Procedure In the open window embed put

LOGONSCREEN
IF RETVAL = '1' THEN SELF.POSTCOMPLETED ; RETURN LEVEL:fatal.

Logonscreen is the procedure to logon

on the logon screen disable the ok button until the password etc are correct. Then just use it to close the current window.
On the accepting cancel button put the following.

RETVAL = '1'
return level:fatal
CYCLE

Hope this helps
JJ
 
Compr & jjyxk845

Thanks for the suggestions. I combined your suggestions & it worked great.

In the main procedure, after the call to UserLogon I put:

IF RETVAL THEN POST(EVENT:CloseDown).

Thanks for the help
PaulaD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top