Discussion:
REMMs in macros in case select list is active
(too old to reply)
Frank Winans
2011-04-08 04:35:34 UTC
Permalink
I often test macros by disabling the tail end of a sselect line, as in
001 N
002 sselect myfile with a3 # "tree" and with a4 = "0"
003 sort myfile (p
getting tweaked to be
001 N
002 sselect myfile with a3 # "tree"
003 REM and with a4 = "0"
004 sort myfile (p

But unlike the PROC "C"omment line feature, the REM verb eats
the select list. So the SORT would show all items, due to the REM

A small PROC " REMM" will work ok, though;

000 REMM
001 PQ
002 C Use remm instead of rem in macro remarks lines to
presererve active list
002 IF #S X
003 HSAVE-LIST ***@PIB
004 PH
005 HGET-LIST ***@PIB
006 PH

Similarly, a DISPLAYY proc could save-list foo / display whatever /
get-list foo
note: remember to put space after y of hdisplay
a\(10,999)
p
Frank
Frank Winans
2011-04-08 04:44:17 UTC
Permalink
Actually, just an empty proc will work fine, too...
Post by Frank Winans
000 REMM
001 PQ
So why'd RD go to the trouble of building up a verb "REM",
was it just to be backwards compatible with R83 or something?
Frank Winans
2012-09-21 12:23:51 UTC
Permalink
Post by Frank Winans
I often test macros by disabling the tail end of a sselect line, as in
001 N
002 sselect myfile with a3 # "tree" and with a4 = "0"
003 sort myfile (p
getting tweaked to be
001 N
002 sselect myfile with a3 # "tree"
003 REM and with a4 = "0"
004 sort myfile (p
But unlike the PROC "C"omment line feature, the REM verb eats
the select list. So the SORT would show all items, due to the REM
A small PROC " REMM" will work ok, though;
000 REMM
001 PQ Use remm instead of rem in macro remarks lines to
presererve active list
The REMM proc works fine instead of REM verb when used
in a macro such as
000 fooA
001 n
002 select md sampling 3
003 remm sampling 3 means limit 3 items get selected
004 sortc md

and is better than REM verb there, since REM 'nukes' any active select list,
but REMM is a bit 'toxic' if you forget and use it in a proc, such as
000 fooB
001 PQ
002 Hselect md sampling 3
003 P
004 Hremm stuff stuff stuff
005 P
006 OWe never reach this line

The REMM, in this case, gets run but does an implicit muffled basic ABORT.
The driver proc fooB stops dead in the water at the point it launches the
REMM.
If you had used REM instead here, fooB would continue on.

NB: 'BUMP' is an acronym 'Bring Up My Post' -- means to reply {usually by
same author} to a very old posting in a newsgroup thread, arguably
gratuitously.
google to internet slang bump

Loading...