|
|
Clarion 6 - General
Started by dEraCh2000 at 09-13-2008 6:44 AM. Topic has 6 replies.
 
 
|
|
Sort Posts:
|
|
|
|
09-13-2008, 6:44 AM
|
dEraCh2000

Joined on 04-30-2008
Sarajevo, B&H
Posts 11
|
|
|
|
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
Joined on 02-07-2006
Posts 12
|
|
|
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
Joined on 05-21-2008
Posts 28
|
|
|
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
Joined on 10-24-2005
Dubai, UAE
Posts 219
|
|
|
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
Joined on 05-21-2008
Posts 28
|
|
|
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
Joined on 10-24-2005
Dubai, UAE
Posts 219
|
|
|
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

Joined on 04-30-2008
Sarajevo, B&H
Posts 11
|
|
|
|
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
|
|
|
|