perm filename PINK.SAI[HAK,ROB]1 blob sn#429121 filedate 1979-03-29 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00003 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	BEGIN "PINK"
C00004 00003	! Program specific DEFINEs and REQUIREs
C00006 ENDMK
C⊗;
BEGIN "PINK"

COMMENT Mini-test in preparation for the PINKY mini-finger;

REQUIRE "{}<>" DELIMITERS;

DEFINE !={COMMENT};

DEFINE SP={" "},
      CR={('15&"")},
      LF={('12&"")},
      ↓={(CR&LF)},
      TAB={('11&"")},
      FF={('14&"")},
      ALT={('175&"")};

DEFINE ⊂ = {BEGIN};
DEFINE ⊃ = {END};
DEFINE THRU={STEP 1 UNTIL};

DEFINE PI = { 3.1415926536 };
DEFINE pos_int_infinity = { '377777777777 }; ! = 34359738367;
DEFINE neg_int_infinity = { '400000000000 }; ! = -34359738368;
DEFINE pos_real_infinity = {  1.70141182@38 }; ! just weird numbers that work;
DEFINE neg_real_infinity = { -1.69808878@38 };


DEFINE clear_screen = { CALL ((-1 LSH 18) + LOCATION ('004000000516), "TTYSET") };

DEFINE ErrQuit(str) = {
    BEGIN
      PRINT(str,↓);
      CALL(1,"EXIT");
      END;		};

! Program specific DEFINEs and REQUIREs;

! Subtring definitions from WHOline info;

DEFINE JobNum(s) = {s[1 FOR 2]};
DEFINE PPN(s) = {s[4 FOR 6]};
DEFINE PRJ(s) = {s[4 FOR 3]};
DEFINE PRG(s) = {s[7 FOR 3]};
DEFINE TTY(s) = {s[11 FOR 3]};
DEFINE JobNam(s) = {s[23 FOR 6]};
DEFINE WHO = '400112;

PROCEDURE GetWho(
  INTEGER Job;
  REFERENCE STRING s);
  START_CODE "GetWhoLine"
	HRLZ 1,Job	;
	HRR 1,s		;
	CALLI 1,WHO	;
  END "GetWhoLine";

INTEGER I;
STRING Str;

BEGIN "IBLK"
Str ← "Here is a dummy string long enough to receive a WHO line, I hope.
	I can always pad it out anyway....";
FOR I ← 1 THRU 63 DO
  ⊂
  GetWho(I,Str);
  IF JobNum(Str) THEN PRINT(JobNum(Str)," ",PPN(Str)," ",TTY(Str),↓);
  ⊃
END "IBLK";

END "PINK";