Monday, January 16, 2017

Priority trick for screen procedures

Whilst checking something buried in a screen procedure within Priority, I came across the following nugget:
SELECT 420, 539 INTO :WRNMSG, :GOTO FROM DUMMY WHERE :RETVAL <= 0;
I wrote a quick procedure which confirmed what I thought this snippet does: if the variable RETVAL is less or equal to zero, then warning message 420 will be displayed and execution will skip to label 539. As it happens, earlier this morning I had written something much less concise than this to achieve the same result, so the find was quite serendipitous.

Here are two more undocumented variables which can be added to one's private toolbox.


2 comments:

Yitzchok said...

That really works as if you had WRNMSG or GOTO commands? It all happens just from setting the variables?

No'am Newman said...

Indeed it does. It pays to read some of the buffer code in ORDERS.