Avoid error message if canvas doesn't exist [message #385579] |
Tue, 10 February 2009 03:04 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
l0b0
Messages: 13 Registered: November 2006
|
Junior Member |
|
|
I'm trying to implement a debug mode in some forms, so that if it's enabled the canvas named "DEBUG" will be set as visible. I've added the code to a when-new-form-instance trigger which is inherited by all the forms, but the problem now is that if the form doesn't exist, set_view_property('DEBUG', visible, property_true); generates an FRM-41053 error message. I've tried catching it, but it doesn't work. I can't find any function to check if a canvas exists, and find_view results can't be compared to null or an uninitialized viewport variable. How can I check that a canvas exists, or avoid an error popup on set_view_property with a non-existing canvas?
|
|
|
|
Re: Avoid error message if canvas doesn't exist [message #385601 is a reply to message #385584] |
Tue, 10 February 2009 04:00 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
l0b0
Messages: 13 Registered: November 2006
|
Junior Member |
|
|
Littlefoot wrote on Tue, 10 February 2009 10:17 | Quote: | I've tried catching it
|
How? Did you try ON-ERROR / ON-MESSAGE trigger? If not, search the board as there've been examples of how to properly do it.
|
Here's the code which results in an error message:
begin
set_view_property('DEBUG', visible, property_true);
exception
when others then
null;
end;
I just realized that on-error is called independently of this - Here's a working version:
:system.message_level := 20;
set_view_property('DEBUG', visible, property_true);
:system.message_level := 0;
Thank you very much!
|
|
|
|