2

I'm trying to find a way to clear displayed data from the screen before return to the calling procedure.

For example:

FIND FIRST table NO-LOCK NO-ERROR.
DISPLAY table WITH 1 COLUMN.
/* data gets displayed */
PAUSE.

Now how do I clear it before returning to the calling procedure?

braX
  • 11,506
  • 5
  • 20
  • 33
Ivan
  • 143
  • 2
  • 12

1 Answers1

2

To make it easy for yourself your should actually ALWAYS name your frames. Otherwise you will run into problems sooner or later. I will let examples below reflect both named and unnamed frames.

You clear it:

FIND FIRST tablename NO-LOCK NO-ERROR.
DISPLAY tablename WITH 1 COLUMN.
PAUSE.
CLEAR.
PAUSE.

You can also pinpoint a frame to clear:

FIND FIRST tablename NO-LOCK NO-ERROR.
DISPLAY tablename WITH FRAME x1 1 COLUMN.
PAUSE.
CLEAR FRAME x1.
PAUSE.

Or if clearing is not really what you want but rather removing (or actually hiding) the entire frame:

FIND FIRST tablename NO-LOCK NO-ERROR.
DISPLAY tablename WITH FRAME x1 1 COLUMN.
PAUSE.
HIDE FRAME x1.
PAUSE.

You can also hide without pinpointing a frame:

FIND FIRST tablename NO-LOCK NO-ERROR.
DISPLAY tablename.
PAUSE.
HIDE.
PAUSE.
Jensd
  • 7,886
  • 2
  • 28
  • 37
  • The last one is what I'm looking for. But specifically for the default frame. To construct my first question in a better way. How do I HIDE the default frame? – Ivan Jun 15 '16 at 06:37
  • 1
    Then you just leave out the "FRAME" part. But it's always nice to have a frame to work with... – Jensd Jun 15 '16 at 06:38
  • Wow it was that simple. Works like a bomb. And if I want to make sure it's hidden after I've returned to the calling procedure, then HIDE ALL also works like a bomb. Thank you so much! – Ivan Jun 15 '16 at 06:47
  • 2
    Not using a named FRAME is considered a very bad practice in production code. I would only accept that in ad-hoc queries. But there you wouldn't have the need to hide frames. So do yourself a favor and name your frames. – Mike Fechner Jun 15 '16 at 06:52
  • @MikeFechner. Indeed! – Jensd Jun 15 '16 at 06:54
  • Agree 100%. It's a must. We're still using the character environment (sad but true). So instead of opening a character terminal every time we want to test a snippet of code or run a bunch of patches, I created a program in the software we develop that is only accessible to developers where they can run any code they want (PERSISTENT or not) without them having to struggle with extra character editors. Just needed a way to make sure that all displayed data was gone before they try to run the next snippet of code (you and I both know they're not going to define frames for everything). – Ivan Jun 15 '16 at 07:15