unexpected frame appears onto another frame after an event

67 views Asked by At

I'm using a character application. In the first page, there is a frame f-selection where the search fields are entered. When I search for something and open some other frames in that search, then I press F10 which is for opening another frame, the new frame opens but f-selection also appears on it. I'm suspecting this code makes it pop up again:

else assign ll-lgst-key1:SENSITIVE in frame f-selection = TRUE
            ll-lgst-key2:SENSITIVE in frame f-selection = FALSE
        

because when I comment these lines, the frame doesn't pop up. But then I can't use these fields at the first frame where I should, too. I don't know why this code is called again; but is there anything else I can do to fix this issue? I tried to write hide frame f-selection everywhere possible but it doesn't work.

1

There are 1 answers

1
Tom Bascom On

That snippet of code is making "key1" of your frame sensitive. In order to be sensitive it needs to pop up...

So the issue is why is that block of code executing? You say "I don't know why this code is called again". Neither will anyone else because you have shared such a tiny little bit of the overall code. Apparently the flow of control is taking you through that block so you should work on understanding why that is. You might try using the debugger to step through the code execution or you could insert some old fashioned MESSAGE statements to get to the bottom of it.

If you want to kludge around the problem you could wrap that bit of code in conditional logic. Define and set a variable that determines the desired state of the f-selection frame and use that to control the sensitivity logic:

define variable f-shouldBeVisible as logical no-undo.

if .... then
  f-shouldBeVisible = yes.
 else
  f-shouldBeVisible = no.

...

 else
  do:
    if f-shouldBeVisible then
      assign ll-lgst-key1:SENSITIVE in frame f-selection = TRUE
             ll-lgst-key2:SENSITIVE in frame f-selection = FALSE
      .
  end.

Of course that looks kind of silly -- but it is just an example with grossly over-simplified logic.

OTOH if you know enough to set the variable you ought to be able to figure out why the ELSE branch is executing. But maybe it is a useful first step.