Subject Re: Form called in .prg is not getting executed
From Akshat Kapoor <akshat.kapoor@kapoorsons.in>
Date Mon, 1 Nov 2021 12:12:36 +0530
Newsgroups dbase.getting-started

Good Morning Milind,

> Facing Issue in executing form when called in a program.
>
> Scenerio :
> ......above code lines
> do t_form.wfm
> .....below code lines
>
> Issue : expecting to exute (......above code lines) and then executing t_form as inputs in the form are used in .....below code lines. It skips and tries to execute (.....below code lines..)
>
> Anything I am missing?
>
> however if I call t_form say in t_form.prg which has code lines
> do t_form.wfm
>
> it executes

How do you know it is not being executed at all. Maybe the form is closing.

To check this insert a msgbox() above the following line in your form.

** END HEADER -- do not remove this line
By default all forms are mdi and hence may be closing.

My default header for all forms is the following pattern

local f
f = new l_inveform()
parameter bModal
f.mdi = false // ensure not MDI
f.readModal()
f.release()
return
** END HEADER -- do not remove this line

Either you adopt the above approach or use the following

do t_form.wfm with true

Hope this helps.
Regards
Akshat


On a side note it is damn difficult to check of a code is not executing
or some other code is executing after that that is nullifying the effects.

Recently I had a issue in a form. I was expecting a effect and that was
not happening.
I tried
form.rapid_en()
?[rapid executed]

I was getting the output rapid executed but no effect in form. It turned
out that another event was firing after that that executed some other
code that nullified the effect of this code.