Welcome to Clarion Community Sign in | Join | Faq

Clarion 6 - General

Started by dEraCh2000 at 09-13-2008 6:44 AM. Topic has 6 replies.

Print Search
Sort Posts:    
   09-13-2008, 6:44 AM
dEraCh2000 is not online. Last active: 10/14/2008 4:49:41 PM dEraCh2000



Top 50 Posts
Joined on 04-30-2008
Sarajevo, B&H
Posts 11
Stop form close
Reply Quote

Hello,

How can I stop a form from closing and updateing records, if a certain logic is not met. When I press OK it should then test the data entered and if they don't meet the terms, or satisfy a certane rule, there shoul be a warning message and the form should stay opened.

Best regards

Armin


   Report 
   09-13-2008, 10:25 AM
johannesb is not online. Last active: 10/19/2008 10:18:42 PM johannesb

Top 50 Posts
Joined on 02-07-2006
Posts 12
Re: Stop form close
Reply Quote
In C6 ABC you could try the following embed point:

TakeCompleted - Before parent Call:
IF Something = Value
CYCLE !Cancel OK button
END
ReturnValue = Parent.TakeCompleted()

Johannes
   Report 
   09-13-2008, 1:37 PM
samir is not online. Last active: 9/28/2008 4:26:28 PM samir

Top 25 Posts
Joined on 05-21-2008
Posts 28
Re: Stop form close
Reply Quote
Hello,
Another way to do the same thing:
1- Right Click your button.
2- Embeds.
3- Accepted.
4- Before Generated Code
5- Insert Source
6- sample code e.g.

if (something is met or not met)
message('Your message',,'~your_icon.ico','&Y|&N')
select(?thefield the cursor should go to) !
any other code
return level:notify
end

Regards,
Samir
   Report 
   09-13-2008, 9:55 PM
Shankar is not online. Last active: 11/14/2008 4:04:22 PM Shankar

Top 10 Posts
Joined on 10-24-2005
Dubai, UAE
Posts 219
Re: Stop form close
Reply Quote
Hi Samir,

Johannes's suggestion is the better one as yours will fail when the ESC key is pressed. EVENT:CloseWindow - before parent call embeds is also ideal.

OF EVENT:CloseWindow
IF NOT CanCloseDown
CYCLE
END


Regards

Shankar
   Report 
   09-13-2008, 11:54 PM
samir is not online. Last active: 9/28/2008 4:26:28 PM samir

Top 25 Posts
Joined on 05-21-2008
Posts 28
Re: Stop form close
Reply Quote
Hello Shankar,

I use that code on almost any control on any window to direct the user to a specified field when a condition is not met. When we were asked not to allow the window to close on a certain condition, some users <G> simply pressed the small reset button to overcome our restriction, knowlegeable ones used the taskmanager to terminate the application. Other kind users entered random data into our required fields claiming that no data was available at the time of entry. I agree with you Johannes's code is neat.

Regards,
Samir
   Report 
   09-14-2008, 11:59 PM
Shankar is not online. Last active: 11/14/2008 4:04:22 PM Shankar

Top 10 Posts
Joined on 10-24-2005
Dubai, UAE
Posts 219
Re: Stop form close
Reply Quote
Hi Samir,

It was just a observation. No offence intended. And, of course there are many ways to abort outside of program control.

Where are you based as you seem to be based in the Middle East. I am based in Dubai, UAE.

Regards

Shankar
   Report 
   09-15-2008, 12:30 AM
dEraCh2000 is not online. Last active: 10/14/2008 4:49:41 PM dEraCh2000



Top 50 Posts
Joined on 04-30-2008
Sarajevo, B&H
Posts 11
Re: Stop form close
Reply Quote

Hello,

Thank you very much for your replies. They were very helpful.

Thanks again

Armin


   Report 
Clarion Communi... » Clarion » Clarion 6 - Gen... » Re: Stop form close

Powered by Community Server, by Telligent Systems