PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Catch "runtime warnings"
Catch "runtime warnings"
Started by schrubbi, Aug., 20 2024 3:40 PM - 3 replies
Posted on August, 20 2024 - 3:40 PM
Hi,

does anybody know how to catch runtime warnings like SetFocus not possible, because the Control is not visible?

Example:
A Layout-Control contains an Edit control. The row of the Layout is set to invisible, the Edit is set to visibile but is de-facto invisible because of the invisible layout row.

SetFocus(Edit) "fails" and shows the runtime warning "the focus cannot be given because the contrl is invisible" in the code editor. But it does not result false (it does not return a value), it does not trigger CASE ERROR, CASE EXCEPTION, WHEN EXCEPTION IN, nor ErrorOccured().

How can I catch those warnings to prevent unexpected behaviours?
(And are there ways to check the de-facto visibility beforehand?)
Registered member
4 messages
Posted on October, 24 2024 - 7:36 AM
Try this




--
Sanjog Ghonge
Posted on October, 28 2024 - 3:31 AM
Schrubbi wrote:
Hi,

does anybody know how to catch runtime warnings like SetFocus not possible, because the Control is not visible?

Example:
A Layout-Control contains an Edit control. The row of the Layout is set to invisible, the Edit is set to visibile but is de-facto invisible because of the invisible layout row.

SetFocus(Edit) "fails" and shows the runtime warning "the focus cannot be given because the contrl is invisible" in the code editor. But it does not result false (it does not return a value), it does not trigger CASE ERROR, CASE EXCEPTION, WHEN EXCEPTION IN, nor ErrorOccured().

How can I catch those warnings to prevent unexpected behaviours?
(And are there ways to check the de-facto visibility beforehand?)


I feel strongly about it and would love to learn more about it. If you could, as you learn more, would you mind adding more information to your blog https://quordle-wordle.com
Posted on December, 10 2024 - 3:24 PM
a écrit :
Try this




--
Sanjog Ghonge


Thank you. My problem with this specific example is that I have a variable control I have to set the focus. When setting the focus I do not know the row which the control is a child of. Or if the control is even part of a layout control.
Windev notices that the control is defacto invisible and throws the runtime warning (the small warning triangle next to the code). There should be a way to catch this warning.

Independent of my specific problem I want to know in general how to catch those warnings. A specific bug fix is not a catch. Your answer implies that instead of using try-catch in software development, we should simply not make errors. That can't be the right way.