===) =+%" 407 zzzupack 407 danbcmds 407 ucmds =˨-DEFINED COMMANDS FILE, Version 3.0, created 2002 9 25 6 28 26v(((=ˈ@ =˨ =3@ =X`DDmtoUSER-DEFINED COMMANDS FILE, Version 3.34, created 2002 9 17 21 54 13====+8 #=HHPv(= =H [ MSGCLEARFILE;trap;F;N;T [1] DANB 840701 ERASE FILE HOLDING TRANSFERED WSS [2] MSG'fILE ERASED' trap'c NOPE' F11wORKfILE [3] (N(names[;1122]^.=F)/Tnums)E F stie N((N)N0,T)0 [4] E:F erase N 0 [5] NOPE:MSG'NO FILE TO CLEAR' =(n< RLP COMPACK RP;io;N1;N2;R1;R2;C1;C2;I;C;N;M;LIM;SHOW;OBJ;T;S;ANY;O [1] DANB 880325 PACKAGE COMPARISON [2] [3] FIRST, FIND ALL OBJ NAMES IN EACH PACKAGE [4] show: 1=SHOW NAMES ;2=CONTENTS ;3=BOTH ;0=NOTHING [5] io1 ANY0 [6] SHOW, 2 2 3show R03fd 'O s',cr,'[1](0s)/0RR,,cr,s' [7] R21C2N2pnames RP [8] R11C1N1pnames LP [9] I1C1 I0,I1C2 N1(IC1)N1 N2(IC2)N2 ADJUST DIMENSIONS [10] [11] NAMES KNOWN, DISPLAY HEADER [12] OBJ' OUTSTANDING OBJECTS IN ' OBJECTS NOT APPEARING IN THE OTHER OBJ [13] (^/C1~I0=N2 matiota N1)/S4 [14] O '***',(4 0 +/I),OBJ,'LEFT' SHOW[4]/'O VM FIT IN1' [15] SHOW[1]S4 NCI/I I~ANY1 SHOW INDIVIDUAL OBJECTS [16] B3:(N [18] [19] S4:(^/C2~I0=N1 matiota N2)/S5 [20] O '***',(4 0 +/I),OBJ,'RIGHT' SHOW[5]/'O VM FIT IN2' [21] SHOW[2]S5 NCI/I I~ANY1 SHOW INDIVIDUAL OBJECTS [22] B4:(NLIM)/0 (T(read T1,I)COMPVAR read T2,I)l2 [10] out C,I out T [11] l2:l1,II+1 =ʝ MCOMPBOOL B;BR;BC;R;C;X;Y;Z;I;LI;S;FIX;N;io;F [1] ST [2] BBOOLEAN MATRIX B M IS B WITH SOME OF THE 1'S REPLACED BY 0 [3] M HAS THE PROPERTIES THAT:(1) 1(+/M),+M [4] (2) EACH 1 IS BELOW AND TO THE RIGHT OF THE PREVIOUS 1 [5] (3) +/,M IS A MAXIMUM FOR CONSTRAINTS (1) AND (2) [6] notes IO0, M IS NOT NECESSARILY THE UNIQUE OPTIMAL SOLUTION OF (3) [7] THIS FUNCTION IS ONE OF THE SEVEN WONDERS OF THE MODERN WORLD [8] MAIN ALGORITHM CALCULATES THE BOOLEAN MATRIX X (LINE L1) WHERE : [9] MAX[I;J]+/,COMPBOOL (I,J)B AND XMAX-0 10,MAX [10] THEN USES THIS TO CALCULATE RESULT AT LINE L4 [11] ST:B(BR/B)(BCB)/B GET RID OF ZERO ROWS AND COLUMNS [12] M(B)RCio0 [13] DIAG:N+/^\, 0 0 B FOLLOW DIAGONAL AS FAR AS POSSIBLE [14] M[R+N;C+N]N.=N RR+NN CC+N B(N,N)B [15] X+/^\^/~B Y+/^\^~B NUMBER OF ADJACENT 0 ROWS AND COLS [16] (0=/X,Y)CALC NO ZERO ROWS OR COLS [17] RR+X CC+Y B(X,Y)B DIAG CUT BACK B AND TRY DIAGONAL AGAIN [18] CALC:(0B)END [19] B(FIXI,~III+1)L1 [22] (0=Y1Z)END Y IS THE NUMBER OF MATCHES [23] ZN1B I1+''B INITIALISE LOOP [24] L4:FZS(ZB[I;]+\X[I;])Y [25] X[I;](-S)NF Z(1*F)Z,S II-1 (0YY-F)L4 [26] X[I+1;]0 [27] L8:XBFIXX [28] SB M[R+S[0];C++S[1]]B [29] END:MBRBC\M Ǚ=hq CF1 COMPFN F2 [1] DANB 84/5/30 - COMPARE 2 FNS [2] (F1F2)C'' [3] C0,1(F1)F2 F1(CF1)F1 F2(CF2)F2 [4] CF1 MCOMP F2 E=ʸ211 NCOMPIND B [1] RETURN NOS. FROM 1 TO +/B FOR EACH ELEMENT OF B SUCH THAT [2] N IS STRICTLY INCREASING AND B/N IS +/B(IO=1) [3] N1+\N/N(1N)-1NB/B1,B,1 N[1]=@" rsa COMPV sb;l [1] compare VECTORS [2] r'' (sasb)/0 [3] r'lISTS'' LENGTH: ',(1l),(/l)/' AND ',1l(sa),sb l/l [4] rr,CR,'tHEY ARE THE SAME FOR THE FIRST ',+/^\(lsa)=lsb [5] rr,' AND THE LAST ',(+/^\(lsa)=lsb),' ELEMENTS.' W=||erta CV1 COMPVAR V2;I;N;S;io [1] DANB 84/5/30 - COMPARE 2 VARIABLES. C'' IF V1V2 [2] io0 (V1V2)C'' [3] ((pchk V1)=Npchk V2)/ST C''[N],' OBJECT IS A PACKAGE' 0 [4] ST:NNP CV1 COMPACK V2 0 [5] NP:(=/N(V1),V2)SR C'g' [6] C,C fmt 100N END [7] SR:(1=N''N)/VEC SAME RANK [8] ((V1)V2)SD C'oBJECTS DIFFER IN SHAPE: ',(V1),' AND ',V2 [9] SD:((S10V1)=10V2)SC CC,(0=C)';OBJECTS DIFFER IN TYPE' END [10] SC:((C),2N)/END,SIMPL [11] C'oBJECTS ARE OF RANK >2; THEY DIFFER AT ',(+/,V1V2),' PLACES' END [12] SIMPL:C'OBJECTS ARE ',(50=S)'CHAR ',,svm[N;] (SCL,VEC,MAT)[N] [13] SCL:CC,cr,V1,V2 0 [14] MAT:CC,cr,VM(V1)COMPFNV2 0 [15] VEC:CV1 COMPV V2 [16] END:(1000<+/size 'V1 V2')0 [17] CC,cr,('vAR1:',cr,VMV1),cr,cr,'vAR2:',cr,VMV2 =ʈoo]] CREP DISPLAY OBJ;SEP;L;D;S;io [1] DANB 840629 DISPLAY OBJECT FROM PACKAGE [2] io1 SEP2cr (VAR,FN,PAK,DONNO)['vfp'1OBJ] [3] VAR:(2SDREP)/L1 [4] LD1'}{ ',(S),'D STRUCTURE: ',1,('<>,r<',av[255+io],'>i8')fmt D L2 [5] L1:SLL/Lcr=D(VMREP),cr LL[nlinesS]nlinespw [6] L2:CSEP,1OBJ,(4010REP)' [C]',cr,(LD),(LD)/' ...[MORE]' 0 [7] FN:CSEP,C,(0=CVM('r< >p<[>q<]>bli5' fmt 1+1REP),REP)/1OBJ,'' 0 [8] PAK:(1 2 (S1OBJ)pnc REP)/DONNO,P1 REPS FNCR REP FN [9] P1:REPS pval REP VAR [10] DONNO:CSEP,1OBJ,' IS UNDEFINED !' or =G her MATFIT MAT;io;W;P;F;DIM [1] DANB 840614 RESHAPE CHAR MAT TO FIT PW [2] W:WIDTH; F:NO OF FOLDS; P:PAGE LENGTH [3] FpwW1DIM 0 2 +MAT [4] DIM[io0]FP(1DIM)F [5] MAT(P,FW) 1 0 2 (F,P,W)DIMMAT e=X~~ RObJ FNCR PaK;F [1] return cr of FN in PacKage [2] 3fd 'F;',ObJ,CR,'[1]pdef ObJ psel PaKRCR ObJ' =xc=0h (H3 11( 194  i =(~a BA JDMR1 W;I;N [1] JOT-DOT-MATCH-RANK 1 FOR RANK 2 A AND W [2] SORT OF A.R1 W [3] N1A BA over W I(30=10A)'avB' BB[I;] [4] I[I]+\/B1B [5] BI[N].=NI =Q DM1 MCOMP M2;X;R;C;io [1] MATRIX COMPARISON [2] DISPLAY THE OBJECT M1 TOGETHER WITH THE LINES FROM M2 WHICH ARE [3] note 2=(M1)=M2 AND (1M1)=1M2 [4] io0 XCOMPBOOL M1 JDMR1 M2 R/X C~X [5] D' '[R],'[,q]li4' fmtR ROW NOS, =LEFT, =RIGHT [6] R(COMPIND R),C/COMPIND~C ORDER OF DISPLAY [7] XM1CM2 DD((+/C),6)' ' D(D,X)[R;] [8] X(1+2zone)-zone ZONE OF DISPLAY [9] RR/RD[;2].=' ' RUNIQUE(/R.<0,1D)/R,R.+X [10] DD[R;] =0 PP0 1 ( (" ( "( ( " ("(  "  ( "  ("  ( (     ((    "( ( ( " (  (  " ( ("    "  " "    "  "" ((  ( ( (    ("  ( (  (    (  ((  (  " "    ( "  ("   " (   (    "  ( ( ( "(    ( " ((   ( "  ""     ( ( (" "   ( ""(   (       (  " "  ""  "  (("( " " ((("  (   " (   ""  ( " "(  ( (    ( (  "   " " ""      (   ("     ( " (  "" ( "   "      " ("  (( ((   ( " ("    ( (   "( ( "  (   (    ((( ("  (         ( (  (" (            ( "   (  ((  ((  " "     (" ((    " "  (     ((  (  (  (   (    (   "  "  ((  ( (  "   "     " ("    ("  "        (  ("  ( (    "(  "     "    (  (( "("    " "    (           (       "((     (     "" "  "      (     (  (   "  (  ( (  ( (   " ((   "( "     (  "   " " ((     ( ( "   ("     ("(    (   (  "((  (  ( ""    " ( (  " (    "  (  (  "  " " (" "  "   ( "    "      "  ((   "      (   "     "(         ( "(   (  ( "((      ("   ( "   ("  (    "   ""    (   (  (   "        "(  "((       ( " " (  (( (    0=ʘ*(H( g  BOws CVws a2a amap ap124 aplascii btaskreq del hostap hsp if pc108 socket ssql toolkit tools unix wssearch wstransfer xfer =VVates VUNIQUE V [1] DANB ELIMINATE DOUBLES FROM LIST V [2] V((VV)=V)/V = nCCssiq ZD VM M [1] MATRIX FROM VECTOR [2] ZD matrify M =ʨ&&nt fGet access to file on another account (SAM) DanB 96 Syntax: ]access lib filename /pass=xxxx /accounts= (SAM only) This command will set the access matrix of the file given as argument to contain your account number (or those given to the /accounts switch) full (-1) access with no passnumber.umber.=ʀReturns the address (file,component) of object as TIE DanB 1992 Syntax: ]ADDR object /FILE=ucmdfile (default primary file) Returns the address (file,component) of object as TIE, CPT (0 if not found). Useful when manipulating UCMD files. =ʘ rAlign comments in functions at column DanB 1992 Syntax: ]ALIGN fn1 [fn2] [...fnx] /COL=[40] Align comments in functions at column (COLumn, if not set, defaults to 4).to 4).=ʀc rChange 1st alphabet characters to 3rd (SAM only) Syntax: ]ascii varname Effect: all characters are swiched between 1st to 3rd and from 2nd to 1st. For character vectors only..=Pts [BenchMark expression(s) DanB 1993 Syntax: ]bm exp1 'e x p 2' ... /n=[100] /space[=_] /quote[="] /trap= Will execute each expression N times (default 100) and return MF result Switch does /n= specifies the number of iterations. Default 100. /space specifies the speudo blank character. Default '_'. This allows to do ]bm myfn_arg instead of ]bm 'myfn arg' /quote specifies the speudo quote character. Default '"'. This allows to do ]bm nc"var" instead of ]bm 'nc''var''' /trap allows to specify trapping action inside the fn Result is 2 enclosed tables of expressionstiming, a n3 columns of /n, cpu in line, cpu in calls.IE =99< is available to help. For example, when the prompt 'Sort, Resize, Delete (space to quit)?' appears you enter something like delete (10),24 to 36,45,78 to 87 A confirmation prompt will appear showing all the files affected by the operation (delete or resize) desired. If the operation requires a passnumber to read/rdfi the files NOT ALREADY TIED then it must be specified with the /sizepass switch. If the deletion or resizing of files is desired and a passnumber is required for the files NOT ALREADY TIED then it must be specified with the /writepass switch.over(=## cmdaccess no;mine;tie;CMD1;STASKMODE;accounts;pass;reset [1] give access to file [2] it works 2 ways: you can give other accounts access to YOUR files [3] (no lib no specified) or you can grant yourself access to an other [4] account's file (provided you know the password to the account). [5] In all cases access is additive unless /reset is used. [6] mine~>/vi no1'/= /accounts= /pass= /reset' parse no [7] accountsaccounts default 1ai [8] minenotmine mine(~reset)rdac tiefopen no [9] minemineaccounts, 0 1 1 0 mine stac tie 0 [10] notmine: [11] '/pass= MUST be specified' signal(0pass)11 [12] 7 signon((^\' 'no)/no),':',pass [13] STASKMODE'gather' [14] rstsend '''',no,'''stie 1' [15] (/'error'r)l10 out r end [16] l10:rstsend 'm(0 30)',(~reset)/'rdac 1' [17] (/'error'r)l20 out r end [18] l20:rstsend 'm(',(accounts),',0 1ۢ1 0)mmstac 1' [19] (/'error'r)l30 out r end [20] l30:out 'access granted' [21] end:stsend ')off' =h( cmdaddr o;file [1] dANb 92 return component of object in file [2] : addr [3] o'/= /file=' parse o [4] (file0)/l1 filefopen file [5] l1:resultfile addr o n=zz cmdalign arg;io;cpos;dlm;fns;i;lab;max;n;s;t;col [1] DanB 1992: align FUNCTIONS AT COLUMN [2] [3] io1 dlm1arg1'/col=' parse arg CHECK SWITCHES [4] colcol default 40 [5] l1:fns(1+iargdlm)arg argiarg [6] (3nc fns)/l3 out fns,' not a fn' l4 [7] l3:t\''''=fns(1 2 t)tcr fns [8] (ii/i1lab)^0lab(<\fns[i;]':')+.1s [11] fns[i;]nt[;max],(1max-col+n+lab)(+/^\' '=s)s(0,max)t(-n)fns[i;] [12] out fx fns [13] l4:(arg)/l1 lp=ʀc r cmdascii var;tr [1] danb 19981213 turn text in 1st bet to 3rd and 2nd to 1st [2] trav i(tr'Aa').-io-26 tr[2i]tr[2i] [3] resulttr[avvar] y..=ʈ,,3 cmdbm eXp;B;cR;fF;fM;trap;n;quote;space;trap [1] DanB 1993 benchmark expressions [2] eXp IS A REGULAR [BLANK] DELIMITED LIST OF EXPRESSIONS [3] eXp'/n= /space[=] /trap= /quote[=]' parse eXp nn default 100 [4] traptrap default '' traptrap,(1trap,''),'e erout 1 0' [5] (0space)l20 (1space)l10 space'_' [6] l10:eXp[B/BeXpspace]' ' [7] l20:(0quote)l40 (1quote)l30 quote'"' [8] l30:eXp[B/BeXpquote]'''' [9] l40:B'r(221*dya) fm f' (1112av='')L50 [10] SAX version [11] B'dyagetr1 MF f0''get:r1MF f' [12] L50:Bfx>'rx fM f;dya''dya2nc''x'''B [13] Bout 0 0 fM fx cR>'fF'آ1cR1 fM 'fF' = 0 cmdcalls xF;xFS;io;xST;xNL;xBR;xS;full;maxlevel;xML [1] dANb 840921 ALL OBJECTS OF ALL CALLS MADE BY ARGUMENT [2] /full IS fULL sEARCH (REPEAT SEARCH FOR ALREADY PROCESSED FNS) [3] /maxlevel IS MAXIMUM LEVEL TO LOOK FOR [4] : cmdcalls crfromvr xC1 xCOMPARE xDF xEQ xFr xFT xGENSYMB xMV xQZ xRD xTREEGEN [5] xF1'/full /maxlevel=' parse xF [6] xFSfull xMLmaxlevel default 9999 io1 xBR 0 0 '' [7] xST(1,xST)xST'',xNLxF [8] xTREEGEN xF = cmdchecklib arg;er;io;ps;trap;a;cd;ctl;inp;i;limits;msg;n;sz;s;tied;ties;tn;toe;t;A;F;P;Q;SAM;S;sizepass;sort;writepass [1] Check current library contents. Allow to delete/resize files. [2] 'arg' is pattern and used to set passnumbers and sort. [3] [4] arg'/= /sort= /sizepass= /writepass=' parse arg [5] (1(0,1ai)1fi arg)4 [6] out '** Cannot perform this command on another user account' [7] 0 [8] If sort not set then sort is on names otherwise it applies [9] to column as in /sort=ts d [10] 4:sizepassfisizepass in case special permission is needed [11] writepassfiwritepass for size and resize/delete [12] limits40 this is for SHARP APL under Unix [13] ps 1 1 0 1 io1 [14] n9999fx>'rQ q''arbout 0q r' fn [15] [16] on SAM we can ask for file system data [17] SAM87av'a' SAMl15 [18] l10:(0>svn nn+1)l10 find suitable clone id [19] out 0 0 0 1 0 svc n(1 2 1002 1) svo n'ctl' ask server [20] out 'Quotas (VC/MF/CF/MS/CS): ',limits4ctlctl'qui f' [21] l15:(S1Fu 'flib ',arg,'/n')none [22] F(S,22)(10 0 1ai),1 ' ',F 22 column format [23] [24] on SAM a user may possess files on another account [25] (SAMS=limits[3])l20 out '* Some files are not shown.' [26] l20:sz 0 5 i0 [27] tied/tnF^.=names tiest,((t)tnums)0 tntn,1 [28] F 0 11 F [29] [30] Find data for each file. File already tied are assumed to use PW=0 [31] [32] trap'19 c l150' skip files you can't access [33] l100:(S'ad')l206 [59] out '** Invalid sort specs - sort ignored',CR l209 [60] [61] l206:sort>t[2] ts1t (2t)l208 name? [62] na[;(4t)2] (t 3 4)l208 date, time? [63] n(t=4+5)/sz (t<9)l208 n-/sz[; 4 3] [64] l208:('d'sort)l209 nn [65] [66] These vars (F, sz, tn) must be kept in sync [67] l209:a1000000a[n;] FF[n;] szsz[n;] tied/ 0 1 tntn[n;] [68] ts((S)Fج>t)>,<9<(0) 4+ta,sz[;4],-/sz[; 4 3] [69] out t [70] [71] Clean up section [72] [73] l210:out toe0 [74] [75] allow to either resize or delete files [76] (a'dDrR'1nQ 'Sort/Delete/Resize ? (space to quit) ')/l215 [77] sort1n ('sS'1n)/l202 new sort [78] space,return quits. Argument is a list of line numbers [79] (' '1n,';')l210,end [80] l215:s,a2 2 7 'deletedresized' (0')5 Ff,,' ',read tie addr f(B1)F [8] 5:F1(B1BF=' ')/F [9] 10:(0fNtie addr f(BF' ')F)20 ' NOT IN FILE' 30 [10] 20:Rcr f (0rep)25 Rrep [11] 25:fN(crfromvr read fN) COMPFN R [12] (0fN)/' (NO CHANGE)' [13] 30:(FBF)/10 N D.=ONE cmdcompmat a;io;zone;C;D;M1;M2;R;X;file [1] dANb 84 MATRIX COMPARISON [2] DISPLAY THE OBJECT M1 TOGETHER WITH THE LINES FROM M2 WHICH ARE [3] mODIFIED 940115 TO COMPARE FROM FILE [4] : COMPBOOL JDMR1 COMPIND UNIQUE [5] io1 d1a'/file[=]' parse a a1a Dad [6] M1C(D-1)a (0file)l10 Xt (1file)l5 Xfopen file [7] l5:M2read X addr C l20 [8] l10:M2Da [9] l20:XCOMPBOOL M1 JDMR1 M2 R/X C~X [10] io0 [11] D'- '[R],'[,q]li4' fmtR ROW NOS, -=LEFT, +=RIGHT [12] R(COMPIND R),C/COMPIND~C ORDER OF DISPLAY [13] XM1 over CM2 DD((+/C),6)'+ ' D(D,X)[R;] [14] X(1+2zone)-zone2 ZONE OF DISPLAY [15] RR/RD[;2].='- ' RUNIQUE(/R.<0,1D)/R,R.+X [16] resultD[R;] o=1    cmd cmdcompufile p;io;a1;a2;a;b;f;h;i;j;m;n1;n2;tn;t1;t2;v1;v2;zone;T1;T2 [1] COMPARES TWO USER COMMAND FILES [2] SYNTAX: ]ucomp FILE1 FILE2 [3] : fit [4] EXTRACT THE a AND b FILE NAMES [5] ioizone1 pmatrify p [6] (i>1p)/l8 a(a' ')/ap[i;] ii+1 [7] (~vi a)/l10 (i>1p)/l8 aa,' ',(t' ')/tp[i;] ii+1 [8] l10:(i>1p)/l8 b(t' ')/tp[i;] ii+1 [9] (~vi b)/l9 (i>1p)/l8 bb,' ',(t' ')/tp[i;] l9 [10] l8:'*** YOU MUST PROVIDE TWO FILE NAMES' 0 [11] READ THE FILE DIRECTORIES [12] l9:tnnums t1fopen a hread t1,2 a1read t1,h[2] [13] n1read t1,h[3] a1a1[iava1;] [14] t2fopen b hread t2,2 a2read t2,h[2] n1n1[i;] [15] n2read t2,h[3] a2a2[iava2;] [16] n2n2[i;] [17] FIND NEW AND MISSING OBJECTS [18] f0 FLAG SET IF ANY DIFFERENCES [19] ja2 matiota a1 (~0j)/l3 [20] CR,' OBJECTS FOUND ONLY IN FILE ',a,':' fit(j=0)a1 f1 [21] l3:ja1 matiota a2 (~0j)/l4 [22] CR,' OBJECTS FOUND ONLY IN FILE ',b,':' fit(j=0)a2 f1 [23] l4: [24] aa,':' tb,':' a((a)t)a [25] b(a)t i0 [26] l1:((j)zi3,i3,2p<:>zi3' fmt 1 6 100ftimerep n1[j[i];3] [36] T1'cnh'[io+ 0 0 20v1] [37] ' IN FILE ',a,' [',T1,'], =',(v1),', LAST MOD=',t [38] t,'i2,2pzi3,i3,2p<:>zi3' fmt 1 6 100ftimerep n2[i;3] [39] T2'cnh'[io+ 0 0 20v2] [40] ' IN FILE ',b,' [',T2,'], =',(v2),', LAST MOD=',t [41] (^/(2(v1),v2),'c'=T1,T2)/l5 [42] CR,' ' [43] l1 SKIP COMPARISON IF NOT CHAR VECTOR OR MATRIX [44] l5:(2=v1)/l6 (n1[j[i];1]=3)/l5f v1CR matrify v1 l6 [45] l5f:v1crfromvr v1 [46] l6:(2=v2)/l7 (n2[i;1]=3)/l6f v2CR matrify v2 l7 [47] l6f:v2crfromvr v2 [48] l7:v1 COMPFN v2 l1 [49] l2:(~f)/'NO DIFFERENCES.' =ʨ F F cmddebug a;io;b;d;e;i;line;l;n;stop;top;trace;S [1] Activates or deactivates stops and traces for a set of functions [2] Syntax:]DEBUG {fcn names} /STOP= /TRACE= /LINE=line nums /TOP[=n] [3] [4] This version differs from APL+Win in syntax: [5] Using /stop or /stop=on sets stops (same for traces);=off removes them. [6] /top affects only top fns on stack [7] [8] io1 S113av'' SAM? [9] Parse the command line [10] a'/= /stop[=] /trace[=] /lines= /top[=]' parse a [11] We are assuming here that no function will have more than 2048 lines [12] lineslines default '2048' default is to list all lines [13] (iferrin 'l',lines)03 [14] out '*** invalid line numbers' 0 [15] 03:linesl [16] ((0stop)^0trace)05 [17] Both stop and trace absent means /stop=on [18] stop1 09 [19] Validate trace & stop. /stop is same as /stop=on [20] 05:n'off'01'on' stop2+n0)/lines [37] d(S/'d+/s',a[i;],'l'),(~S)/'dl stop a[i;]' [38] (~iferrin d)/5 change stop setting [39] ER(~errmsg'domain error')/errmsg pass up other errors [40] ER(01 fd a[i;])/errmsg err is unexpected unless fcn is locked [41] dl [42] 5:e~dl (trace=0)17 l(trace>0)/lines [43] SAM will ALWAYS report a change [44] d(S/'d+/t',a[i;],'l'),(~S)/'dl trace a[i;]' [45] (~iferrin d)/17 change trace setting [46] ER(~errmsg'domain error')/errmsg pass up other errors [47] ER(01 fd a[i;])/errmsg err is unexpected unless fcn is locked [48] dl [49] 17:ee~dl [50] nn+e count num fns for which stop/trace was changed [51] 3 Endloop [52] 26:b^/e0trace,stop d'Changed ',(e[1]/'trace '),b/'and ' [53] out d,(e[2]/'stop '),'settings for ',(n),' functions out of ',1a = prtl rcmddfts lines;io;all;b;fnrep;fn;lines;t [1] danb 20020922 Display Function on Top of Stack [2] Usage: ]dfts 2 to 19, 23 to 67, 99 or all~2 3 4 [3] io1 (/b/'*'=t2 ws 2)er2 fn(^\fn'[')/fnt[b1;] [4] (lines^.=' ')select [5] (0t1 fd fn)er2 out t [6] 0 [7] select: [8] all1+1fnrepcr fn (0all)er2 [9] (iferrin 'lines,lines')er1 [10] (0lines(linesall)/lines)er3 [11] only some lines requested, see which ones [12] out('p<[>i5,<] >' fmt lines),fnrep[1+lines;] [13] 0 [14] er1:out '*** Wrong line numbers' 0 [15] er2:out '** Unable to see top function' 0 [16] er3:out '* No lines selected' 0 = 5 5 cmddisplay 0;ps [1] DanB 20020924 ]display a la APL+Win [2] ps2/- 1 2 [3] (iferrin 'result0')0 [4] out errmsg jXb=mm cmd cmddownload arg;trap;ctl;nohsp;tn;t;H;PCfile;file;fn;tr;var [1] Download file to PC - must be running HDS108 type software [2] (223runs)l10 file (arg) may be tie no [3] out '* Not with IDSH' 0 [4] l10:tn1fi arg1'/= /file= /fn= /tr= /var' parse arg [5] fx>'rx nohsp c''r(~H1,c)/c' H1av to NOT process HSP [6] varl18 vararg arg'pcxfrtmp' (iferrin 'tnfopen arg')l16 [7] (arg,' 12000') create tn1+/0,nums [8] l16:drop tn,-/2size tn var append tn l20 [9] l18:((1t)^>/tvi arg)l20 [10] (iferrin 'tnfopen arg')l20 [11] out '** Cannot open <',arg,'>' 0 [12] l20:PCfilefile default(+/^\arg' 0123456789')arg [13] translate(''1t)'',ttr default 'ipsa' [14] fn default to but could be of [15] (fn default '') downloadfiletoPC tn 0 8=} cmded a;io;b;c;d;e;file;f;n;p;stop;S [1] DANB 92 EDITS OBJECTS IN THE CURRENT FILE [2] /file=FILE WILL ACT ON DIFFERENT FILE [3] : addr nc edit ohl [4] io1 a1'/file= /stop' parse a S'A'165av [5] (stoparg)/arg(arg' ,+') 1 [9] dates:trap'19 e E1nn,0231 e untie nums~tiedlc' [10] (0cd)mod (^/n~cd'/- ')d10 cdn\n/cd [11] d10:tY2K>1n 0 100 100 100fi cd n[1]n[1]+tY2K+10060>1001n [12] cdtstofl n n0t1result [13] 'nn,cd<12rdfi tfopen result[i;]' fori t [14] (0resultnresult)end [15] mod:(0md)end (^/n~md'/- ')m10 mdn\n/md [16] m10:tY2K>1n 0 100 100 100fi md n[1]n[1]+tY2K+10060>1001n [17] mdtstofl n n0t1result [18] 'nn,md<78rdfi tfopen result[i;]' fori t [19] (0resultnresult)end [20] other constraints here [21] end:E>,<'** Some files could not be checked for dates' [22] nofit0 resultfit result[avresult;] =ʀBf cmdfns str;nofit [1] RETURN ALL FUNCTIONS CONTAINING PATTERN str [2] str1'/= /nofit' parse str [3] resultwsnl 3 (str^.=' ')l10 [4] resultstr manymatch result [5] l10:nofit0 [6] resultfit result =M cmdfori EXP;io;i;i;n;F [1] Execute expression FOR I:=limits[2] [by count] [2] io''globals [3] i\<\EXP SS '/i=' ER(~/i)/'/I= must be present' [4] i3i/EXP EXP(~i)/EXP [5] (2 3 =n,i)/2,3 nio,n-~io [6] 2:nn,1 [7] 3:((1n)=-/2n)0 i''Ң1n [8] i18,EXP EXPiEXP [9] ifx(3,i)(i'F'),EXP,i'',(i<0)'1n-ii+i' [10] i''n n11n F [11] DANB 92/11/27 WILL exp FOR I:=N[1](OR IO) TO N[2] ead=1 44 cmd cmdfrdci arg;DR;Ityp;axs;cmp;dispfmt;e;j;lp;m;pe;q;s;stop;t;tn;type;who;er;ps;trap;empty;end;lock;skip;start [1] DanB 940810 from MF - display RDCI for each file cpt [2] q'/empty /lock= /skip= /start= /end= /= ' parse arg [3] lockfilock tnfi q ((1=j)^1jvi q)l1 [4] (iferrin 'tnlock fopen q')l1 [5] out '*** Unable to open that file' 0 [6] l1:ssize tn,lock [7] start & end may have a sign meaning +start or -end [8] stops[2]-1 (0mend)l3 t4>q'+-'1m m(2q)+1fi tm [9] stopstop(m1*q)+t1q2s t:signed; m:number; q:odd=-,even=+ [10] l3:js[1] (0mstart)l4 t4>q'+-'1m m(2q)+1fi tm [11] jj(m1*q)+t1q2s t:signed; m:number; q:odd=-,even=+ [12] l4:'sapl.type' bind 'Ityp' define intrinsic fn [13] fx>'rDR c''r''PBIFJCE?''[111 111 112 113 117 124 236103 Ityp c]' [14] axs1 assume we have access [15] m'* unavailable *' trap'19 c l5' ps 1 1 0 1 trdfi tn [16] mtimefmt, 0 1 q 1 1 0 1 t mm,' by_3555555'tai[1]tq[;,1] [17] l5:m(1<'/Created : /Last access : /Last changed: '),><1 m [18] q('File name:',2names[nums''tn;])'size='s [19] out q,mtrap'' [20] (j>stop)empty [21] /skip tells how many cpts to skip at a time [22] if % then consider it a portion of the range [23] (q'%'skip)l6 skipskip~'%' [24] l6:skip(~q)+skip default 0 [25] ql7 skip1(--/2s)skip100 [26] l7:s3s[2] size of cpt field [27] dispfmt'i',(s),',3a1,bi8,2bi9' e0 last Empty? [28] out((s-3)''),'Cmp T Size Who When Shape' [29] loop:cmpread tn,j,lockpee e0 [30] ('P'typeDR cmp)l10qpnames cmp [31] (eempty<0qcmp)skip [32] l10:m20'* NO access *' s 0 0 trap'19 e axs0lc' [33] axsl20 m,timefmt 2srdci tn,j,lock [34] [35] l20:out(,dispfmt fmt(j(1pe':')' 'type1 2s)),' ',m,' ',q [36] skip:(stop>S AR cmdfread arg;cpt;n;tie;keeptied [1] DanB 20020924 Read from file specific component [2] Use when file is not tied and only one component needs to be read [3] arg'/= /keeptied' parse arg use ' ' as delimiter [4] n1n/n' '=arg (vi cptnarg)er2 cptfi cpt [5] (iferrin 'tiefopen narg')er1 [6] tiedtied,keeptied/tie [7] (iferrin 'resultread tie,cpt')er3 [8] 0 [9] er1:out 1')*** Unable to tie the file (',errmsg 0 [10] er2:out '*** Invalid component number' 0 [11] er3:out '*** Error: ',errmsg 0 =ʚXXe cmdglobals xN;io;xBR;xDel;xDF;xFS;xL;xML;xNL;xR;xST;pw;fmt;full;fun;upd;var [1] dANb 840920 GLOBALS REFERRED TO BY xN [2] /full ALSO PERFORMS A RECURSIVE SEARCH ON ALL CALLED FUNCTIONS [3] /fmt WILL FORMAT THE RESULT [4] /upd WILL WRITE THE RESULT IN THE FUNCTION [5] /fun RETURNS THE NAME OF VISIBLE funcTIONS THAT ARE CALLED [6] /var RETURNS THE NAME OF VARIABLES OR UNKNOWNS USED [7] bY DEFAULT BOTH /fun AND /var ARE SET TO 1 IF NONE IS SET [8] : xMV xC1 xCOMPARE xEQ xFr xFT xGENSYMB xQZ xRD xTREEGEN fit [9] 960809 modified for all ws usage [10] io1 xL1'/fmt /full /fun /upd /var' parse xN [11] fmtfmtupd update implies format [12] xRfun=var (upd^~xR)xl5 [13] 'Update only one of function/variable will destroy previous' [14] 'comments in functions. Continue? ' ('yY'.=1)0 [15] xl5:funfunxR varvarxR [16] (' 'xDel1xL)xl10 xL,allfns,xDel'/' [17] xL may contain multiple names [18] xl10:xNxL[ɢ1+xLxDel] xL(1+xN)xL [19] xML1+9999full [20] xNL(funvar)/'(3','='[1+var],'nc xL)xL' [21] xST'xNLxNL xC1 ',xNL,'0 1(xR[;2]>.='''')xR' [22] xBRxNL 0 0 xFS1 FULL SEARCH [23] xSTfx((xST)'xL xDF xR'),[0.1] xST [24] xST(1,xST)xST'',xN [25] xTREEGEN xN [26] xRxRD xNL [27] fmtxl99 pw75 xRxR[avxR;] [28] xNL(' '.xNL)/xNL(xBR3=nc xR)xR [29] xSTfun'Required subroutines:' over 1pw fit xNL [30] xNL(' '.xNL)/xNL(~xBR)xR [31] xSTxR' ',xST over var'Global variables:' over 1pw fit xNL [32] updxl99 update implies format [33] xNL(xNL[;2].'>')xNLcr xN xST1++/^\''=1xNL[;1] [34] xRfx xNL[xST;] over('','>',xR) over(xST,0)xNL [35] we only return the last value in this version [36] xl99:resultxN xC1 xR (0xL)0 out '> ',xN out xR xl10 =] cmdhex n;io;hn;i;x;back;char [1] dANb 93 hexadecimal of n (integer OR charACTER) [2] r(n)4. wORKS backWARDS USING /back [3] io0 x'0123456789abcdef' [4] (''1n1'/= /char /back' parse n)/5 n1n [5] 5:back/30 char/10 nfi n 20 [6] 10:navɢ1n [7] 20:result,' ',x[(416)n] 0 [8] 30:hn0 wORKING backWARDS, n IS HEX [9] 40:(n^.=' ')/50 hnhn,16x(in' ')n n(i+1)n 40 [10] 50:resulthn char0 resultav[hn] =]]pty cmdhistory N;C;H;S;T;V;version [1] dANb 850708 UPDATE HISTORICAL INFORMATION. [2] iF N>version THEN IT IS NEWER VER NO. OTHERWISE IT IS INCREMENT. [3] iF 0 USE CURRENT NO. [4] S'/= /version=' parse N Nversion default 0 [5] V'VERSION' H'HISTORY' VAR NAMES [6] (0nc V)/V,'1' CV cURRENT vN [7] (N0)/'CN',(C>N)/'+C' ADJUSTED [8] (nc H)l1 T 1 30 30'VERSION DATE DESCRIPTION' H,'T' [9] l1:T(5 2 7 0 C,1001003ts),S V,'C' [10] N(T)1VH V((1V),N)V TNT [11] H,'VT' [12] out 'COMMENTED VERSION ',C ]=xZZum[z cmdinputxt var;i;cr;in;new [1] danb 1993 inputxt into variable [2] (new0=inc var)l10 ER(2i)/'invalid name' [3] var,' CONTAINS ',(var),' CHARACTERS' [4] l10:in0'end input by space,cr' crCR [5] ((0i)^' '^.=i)/end inin,i,cr lc [6] end:in1in drop last cr [7] var,'',((~new)/var,','),'in' =P&& cmdkeepfnsof fn;all;o [1] dANb 941026 kEEP ALL THE FNS RELATED TO fn [2] (fn^.=' ')1 fnlx [3] 1:ER(3nc fn)/'invalid function: ',fn(+/^\' '=fn)fn [4] ofn over u 'globals ',fn,'/full' [5] (+/ex(0=o matiota all)allnl 2 3),' OBJECTS ERASED' [6] =l<( cmdlockedfns arg [1] dANb 92 fIND ALL LOCKED FNS IN WS [2] result(0šҡ1fdarg)argnl 3 [3] result(,2'''),(0cr''',1 arg)argnl 3 =^y>( cmdlog arg;tie;ts;keywords [1] activity log - lOG arg TO LOG FILE [2] tiefopen 'monitor' arg1'/= /keywords=' parse arg [3] keywordskeywords default 'activity' [4] out 'Entry ',(((2 ws 1)arg) appendr tie),' filed.' =1  rc rcmdmonitor Arg;io;pp;ps;trap;accnos;apply;b;ci;cpt;c;date;debug;d;file;f;id;max;nows;ns;nu;nw;pass;pw;string;s;tie;t;user;u;wait;ws;w;yt;out; [1] Read monitor file from n1 to n2 components. daysin timen stie [2] n1 : read first n1 (or last if <0) components [3] n1 n2 : start/end limits [4] [5] /apply= fn to apply each cpt read [6] /date : arg are dates. 'Y' and 'T' can be used for yesterday & today [7] /file = allows to change the file to be read [8] /nows : no ws info exists [9] [10] /pass = allows to supply a passnumber to the monitor file [11] [12] Filters may be specified for string, user AND workspace: [13] /ws = use string to search in workspace [14] /strin= use string to search in text [15] /user = allows to select components written by user [16] /wait : will enter wait loop and display msgs as they are logged [17] [18] If exclusion is desired use '~' BEFORE the value (as in /ws=~XYZ) [19] [20] '' io1 ps 1 1 0 0 pp10 [21] s'/= /apply=/date/file=/nows/string=/user=/wait[=]/ws=/debug/pass=' [22] Args parse Arg [23] sdebug/l100,next (113=av'')s10 scmdmonitors s20 [24] s10:ss stop 'cmdmonitor' non SAM [25] s20: [26] OUTput fn [27] t3 fd 'out c',CR,((~0apply)/apply),' c' [28] fn. Can be used with /apply [29] t3 fd 'rn max a',CR,'r(n1r)ra' [30] tt<1t' '=d' ',Arg where args begin [31] yt0.5'tTyY't/d are surrogates used for dates? [32] wsws default '' useruser default '' datedate/ 1 2 yt [33] nw'~'ws wsws~'~' nu'~'user userfi user~'~' [34] ns'~'1stringstring default '' stringnsstring [35] ffile default(1ai),' monitor' [36] the account numbers known [37] pwpass default 0 accnos,>IDs[;1] IDsIDs[;2],<'' [38] determine component limits; tie [default] filename; try pw of 0 once [39] sc 0 1 +2sizepw,tiepw fopen f [40] 'File <',f,'> tied to ',(tie),'. Component range is ',c [41] w0/s)/l130 w'?' (nows''cpt cpt1cpt (nw/wsw)l70 [52] l50:u9,>IDs[accnosid11cirdci tie,c,pw] [53] keep if user not specified (0) or (~) in id [54] (0user)/l55 (nuiduser)l70 [55] l55:(string)l60 (ns1stringcpt)l70 [56] l60:'Entry ',(c),',',u,' (',(id),') ',w,' ',,6,timen 2ci [57] out cpt '' [58] l70:next,ss+ 1 0 [59] [60] ARGUMENTS ARE DATES [61] [62] l80:d2460*3 (/wyt 2 1)l85 1/60th secs in one day [63] Arg[b/byt1]dt21975+daysin 1003ts today's date [64] Arg[b/byt2]dt- 2 3 1[5 6 7t] yesterday's [65] l85:(f(~w)/w)l90cs transform dates into sec/60th [66] time used in universal. We bump 2nd date by 1 to act like cpts nos [67] Arg[f]d21975+(f2)+daysin t+10000ts[1]1300>tArg[f] [68] [69] perform binary search on start date [70] l90:(1-/c)/l100 c[1+Arg[1]<2rdci tie,f,pw]f0.5+/c l90 [71] l100:csArg[1]1c (2=Arg)/l110 sArg,1s next [72] perform binary search on end date [73] l110:(1-/c)/l120 c[1+Arg[2]<2rdci tie,f,pw]f0.5+/c l110 [74] l120:Arg[2]1c next,sArg [75] [76] EOF reached. Should we wait? [77] l130:s(1s),(size tie,pw)[2]-1 [78] waitbye trap'1000 c end' next,dl wait [79] [80] end:CR,'*** monitor ended ***' [81] bye:untie tie =d) cmdnames pat;io;del;names;n;pat;tie;file;nosymb [1] ]unames with better pattern [2] io1 del1pat'/nosymb /file=' parse pat [3] /nosymb removes the symbol [4] (file0)l10 fileufiles[1;] [5] l10:tiefopen file result0namesread tie,(read tie,2)[2] [6] l20:(pat)l30 pat1pat n1+patdel [7] resultresult(npat) patmatch names [8] patnpat l20 [9] l30:nosymbl40 l40 [10] l40:resultfit(result)result [58u=ʘ2' cmdnoclash name;io;b;loc;l;n;stem;t; [1] dANb 92 - cHANGE ALL LOCAL NAMES IN name TO 0, 1, 2,... [2] name'/n= /stem= /= ' parse name [3] n1000n default io''globals [4] stemstem default '' [5] locu 'objects ',name [6] KEEP ONLY LABEL OR NON-SYS LOCAL [7] loc 0 1 ((loc[;io]'lL')loc[;2]>.='')loc [8] REMOVE ~ NAMES IF ANY [9] t2' ',' ',(l/b(t)(,t) SS '~')tcr name blb [10] tmatrify(,0,0,\b)/,t loc(0=t matiota loc)loc [11] (1loc)0 name,': no change to perform' 0 [12] 0:n('<',stem,'>,li5') fmt n+(1loc)-io [13] u 'osr ',(,loc,' ',n),'/x=tc/a/l/ri/o=',name =ʀBf cmdobjects a;fmt;sort [1] dANb 92 - RETURN ALL OBJECTS USED BY fn [2] a'/fmt /sort /= ' parse a [3] resultxFr 1 fd a [4] sort1 resultresult[avresult;] [5] 1:fmt0 [6] resultxFT result =p cmdohl fN [1] oRDER hEADER lOCALS [2] (' '^.=fN)10 fNallfns 20 [3] 10:fN' ' matrify fN [4] 20:ohl fN[io;] (0fN 1 0 fN)20 =l cmdosr cmdosr;OSSPATMATCH;cmdla [1] DANB - oBJECT sEARCH rEPLACE - VER 4.5. NOW RELIES ENTIRELY ON osr [2] resultcmdla osr os cmdosr =8t [3 cmdoss aRg;pkgmatch;cmdla [1] dANb - oBJECT sEARCH sTRING - vERSION 4.6. nOW RELIES ON oss [2] resultcmdla oss os aRg cmdla refined in os = '** cmdpackages LiSt [1] DanB 970713 return list of packages in names [2] (4nc LiSt)Ll1 LiStLiSt,(' '^.=LiSt)/'nl 2' [3] Ll1:LiSt(2=nc LiSt)LiSt [4] LiSt(0=svo LiSt)LiSt prevent hangups [5] LiSt(,1'),(2=pnames ',1 LiSt)LiSt [6] (0LiSt)0 '(None)' =@ rcmdprtlines startend;io;acc;block;ch;cr;ctl;curl;dat;dflt;file;hsp;lines;lpp;specs;start;tie;width;file;for;paper;remo;title [1] extract lines from session log and send to a printer [2] startend start and [end] (inclusive) line numbers to be extracted [3] specs: /remo=(def sa0120) /for=(default account) /file to file only [4] e.g. ]prtlines /for=danb print all pages [5] ]prtlines 100 500 /remo=rtor print lines 100 to 500 [6] rio1 (2runs[1;3])l10 [7] 'use with IDSH only' 0 [8] default limits to 1 9999 [9] l10:startend'/= /remo= /file[=] /for= /paper= /title=' parsestartend [10] 1 pos Number= 1 to N, 1 neg N= N to end [11] chstartend21,fi startend (0<1ch)l15 startendch[2],999999 [12] l15:accai[1]chav[256]crav[157] [13] lpp66width80 startend per page maximum width [14] block100 number of lines [15] dfltfor default 1cr,'*** user ',acc [16] remoremo default 'opns' [17] ('p'paper1paper default 'portrait')l20 [18] lpp45width132 [19] l20:specs'erase,remo(',remo,'),do1,s',paper,'01,pn2',dflt [20] 1 svc 'ctl'6 svo 'ctl'svn ''runs [21] let's find what's the last line [22] datctlctl(0'line'),(0'line c'),(0'line') [23] (0er>''dat)/lEr1 [24] ctlctl0'line ',2>(>(>dat[2])[2])[1] THAT's the current line [25] (0er>''curl>dat[4])/lEr1 [26] curl(vi curl)/fi curl2>(>curl[2])[1] THAT's the last line [27] start1startend(999999,curl)2startend,curl [28] signal(/startend)/11 domain error [29] (010filefile)cre [30] file 0 7 (file[;7]^.='tempprt')file 0 11 lib acc [31] 'Output file: ',file'tempprt',(^/('li4' fmt1+1file).file)1 [32] cre:file create tie1+/0,nums [33] (10000+80-/startend) resize tie [34] dflt append tie [35] (0title)l30 [36] title append tie [37] l30: [38] lLpS:linesstart,(1startend)block+start [39] datctlctl0'get ',lines [40] (0er>''dat)/eras [41] (0er>''dat>dat[2])/eras [42] dat1>cr,>2ա>dat>dat[2] [43] dat append tie [44] ((1startend)>start1+1lines)/lLpS [45] lLpE:(0file)lEnd erfx(1+lEnd,0)cr 'cmdprtlines' [46] tie hsp specs lEnd 1 1 0 pfile tie [47] eras:file erase tie 0 [48] lEr1:'Unable to retrieve lines from session log' [49] lEnd: [50] za hsp b;ec;fn;hsp [51] (fn(names^.=' 99 hspsystem ')/nums)l0 [52] '99 hspsystem' stie fn((fn)fn0,nums)0 [53] l0:signal(0=10zfx read fn,5)15 z z =ald)/1 cmdrenum name;io;b;i;loc;l;n;stem;t;x; [1] DANB 92 - cHANGE ALL LABELS IN name TO BE IN ASCENDING ORDER [2] CHANGE THEM ALL TO 1, 2, 3, ... [3] io''globals name1'/n= /x= /stem= /= ' parse name [4] SWITCH /n= ALLOWS TO START,INCREMENT, DEFAULT io,1 [5] iio,1 (0n)/0 ii2fi n [6] 0:ni [7] sWITCH /stem= ALLOWS TO CHANGE LABEL sTEM. dEFAULT [8] (0stem)1 stem'' [9] 1:stemstem~' ' [10] locu 'objects ',name [11] KEEP ONLY LABEL OR NON-SYS LOCAL [12] loc 0 1 (loc[;io]'lL')loc [13] REMOVE ~ NAMES IF ANY [14] t2' ',' ',(l/b(t)(,t) SS '~')tcr name blb [15] i'' (x0)2 ix,' ' [16] 2:tmatrify i,(,0,0,\b)/,t loc(0=t matiota loc)loc [17] (l1loc)3 out name,': no change to perform' 0 [18] 3:t'li6' fmt n[io]+n[1+io]-io-l stem(l,stem)stem [19] name osr '/tcalr',(,'/',loc,'/',stem,t)~' ' =r=', cmdsecurews x;cmdsecurews [1] DanB 1998 secure workspace by changing all references to damaging [2] file ops to inoffensive equivalent. bounce et al also affected. [3] (0xu 'lockedfns')l10 '*** WARNING: locked fns! ***' [4] l10: [5] x'//repl/Repl/app/App/bounce/Bounce/drop/Drop/cre/Cre' [6] xx,'/rena/Rena/stac/Stac/lsta/Lsta/runs/runs/run/Run' [7] osr x =ʰ11F cmdshow obj;io;pp;del;d;n;r;s;t;uf;R;data;file [1] DanB 92 show objects on file [2] R'' gather results. /data returns extra data (only if /data=o) [3] dpp16 io1 del1obj1'/data[]o /file=' parse obj [4] (0file)l0 fileufiles DEFINED IN ucmd [5] l0:uffile'*'(21,file)file [6] TRY ufiles SPECIFIED OR all OF THEM BY DEFAULT [7] l1:t'' (0uf 1 0 uf)/no n(1+objdel)obj [8] (02r(fopen uf[1;]) objdata n)/l1 (data0)l5 [9] d' cpt ',r[2],,(r[3 4]0)100 0 1 ftimerep 2r [10] tn,' found in ',uf[1;],d,CR ('o'data)next [11] l5:s'**package**' (2pnames dread 2r)l6 s1,CR,d [12] l6:tt,s next [13] no:t'** "',n,'" not found' [14] next:RR,' OR WHATEVER MARKING SYSTEM MAY BE DESIRED [14] (0comment)l4 comment'' [15] l4:commentmark,when,who,' ',comment [16] l5:(' '^.=arg)/exit iarg' ' fniarg argiarg [17] (0crcr fn)l7 [18] l5,' IS LOCKED OR SHADOWED' [19] THIS LINE TO BE COMMENTED OUT IF REMOVAL OF PREVIOUS mark UNDESIRABLE [20] l7:cr(-2rep^mark,(1,mark)cr)cr [21] l5,':',3 fd cr over comment [22] exit: [23] 15 mAY 1993 BY dANb THIS tag LINE WRITTEN BY THE tag COMMAND ! =ʸArg[ cmdtimefmt ts;trap [1] DanB 94 convert packed time argument to formatted ts format [2] right argument: rdci-type timestamp(s) of any shape [3] trap'c er 0' [4] (ts^.=' ')l10 [5] 'Argument cannot be empty' 0 [6] l10: [7] resulttimefmtts = cmdtref ls;io;cLaSs;nAm;sYm;b;f;i;l;main;noapl;n;recur;sort [1] dANb 940830 cONTRUCT A TABLE OF REFERENCES BY ls (FNS) [2] ls1'/main[=]names /noapl /sort /recur /=' parse ls [3] sYmcLaSs 0 0 '' io1 (ls)l2 [4] lswsnl 3 get only fns outside of ucmds [5] l2:l1lsremshadowed matrify ls lsls~>,* Unable to tie file <',file 0 [9] l7:out 1'>* Checking file <',file [10] tread tie,2 [11] names(0 6 b)bread tie,t[2] [12] numsread tie,t[3] nnums[inums[;2];] [13] numsn namesnames[i;] [14] l10: check the table data [15] (0fx>,<'f',,';',names)l20 [16] out '*** Names table contains invalid names' [17] l20:(ttnums[;2])l30 [18] out '*** Numeric table contains float numbers in 1st 2 columns' [19] l30:(^/nums[;1] 2 3 5)l40 [20] out '*** Numeric table contains invalid type in column 1' [21] l40:(^//nums[;2].<2size tie)l50 [22] out '*** Numeric table contains invalid cpt# in column 2' [23] [24] check the packages [25] l50:pnames[;3]^.='pkg'ex 'f' recoup 'f' [26] (/f~b2=p/nums[;1])l60 [27] out '* The following packages are not classified as variables:' [28] out fit fpnames [29] l60:t0nb/p/nums[;2] [30] 'tt,2>pnames read tie,n[i]' forin [31] (/t)l70 [32] out '** The following variables are not packages:' out fit tbpnames [33] l70: [34] find the functions [35] fns(pnums[;1]=3)names np/p 'p' is where fns [36] try to define them locally [37] b0fx>'rn rel r;rel''fx>(''rel;'',n)''r0103fd r''' [38] 'bb,fns[i;] rel read tie,nums[n[i];2]' forin [39] (/b)l80 [40] out '*** These functions could not be fixed:' out fit bfns [41] l80:i~bnames[;6].'pkgcmd'ex 'rel' get rid of local fn [42] n0=fnames matiota n((-n+/t=' ')t),((1t 0 6 inames),4)'doc' [43] (/n)l85 [44] out '* No doc for packaged commands' out fit nt [45] l85:b[(~n)/f]0 [46] cmd0t(,'/',allbnames)~' ' look for all names [47] (/p)l90 any fn to look at? [48] [49] search the file (starting at cpt 11) for all the names [50] rel0<(tie,11) oss '/lrcta;q',t syntactic, not local, no banner [51] keep only data related to functions (calls to self already excluded) [52] i1relrel[10+b/nums[;2];] 'rel' is square. [53] remove "calls" from variables [54] rel[(3b/nums[;1])/i;]0 [55] all the commands are roots [56] cmd(ball[;3]^.='cmd')/i [57] relreli= 1 0 b\cmd [58] all 'grp' are deemed used by their commands [59] nall matiota 'grp',1 all[cmd;] [60] rel[cmd;]rel[cmd;]n.=i [61] all 'doc' are deemed used by their commands [62] t-n+/' '=all[cmd;] [63] nall matiota 0 3 n(tall[cmd;]),1 'doc' [64] rel[cmd;]rel[cmd;]n.=i [65] trel ('debug'sp)look 'unused'(~t)all [66] look:bt (btt.^rel)look find unused descendants [67] (^/t)l90 [68] out '* These objects are not referenced anywhere:' fit(~t)all [69] l90: [70] check the 'grp' variables, they should contains all the names [71] of the used objects [72] i0 [73] chkgrp:((cmd) command <',n [80] check doc for that command [81] (0/b)chk20 1 grp and only self as call then: [87] out '**',f,' has no group and uses' out fit calls [88] chkgrp [89] grp exists - chk against calls [90] chk20:b(' ',CR) matrify read tie,nums[t;2] fetch the list [91] t(0=('cmd',n) matiota b)b remove cmd name [92] (/b0=t matiota calls)chk30 [93] out '** These objects are used and not in group of',f out fit bcalls [94] chk30:t(0 3 t)t t(t[;3].'pkg')t remove packages references [95] (/b0=calls matiota t)chkgrp [96] out '* These objects are not used and are in group of',f out fit bt [97] chkgrp [98] echkgrp: [99] out '* End of verification' = w cmdvars str;nofit [1] RETURN ALL VARIABLES CONTAINING PATTERN str [2] str1'/= /nofit' parse str [3] resultwsnl 2 (str^.=' ')l10 [4] resultstr manymatch result [5] l10:nofit0 [6] resultfit result = cm cmdversion arg;io;cpt1;p;tie;ver;file;set [1] DanB 20011002 determine user command version or set it [2] io1 tiet 't' is a global holding the current ucmd file [3] argfi '/= /set /file=' parse arg [4] 'invalid version number' signal(setarg)11 [5] (file0)l10 [6] file specified, tie it [7] tiefopen file [8] l10:file1'><',1(p1pver=' ')/ver,names[numstie;] [9] resultfile,': ',cpt1read tie,1 [10] set0 [11] ver1fi(p7+('Version'cpt1)1)cpt1~',' [12] 'invalid version number' signal(arg>ver)11 [13] resultfile,' was ',pcpt1 [14] cpt1(pcpt1),(arg),', created ',6ts [15] cpt1 replace tie,1 =x cmdwhois x;l [1] find name of x; IDs is global [2] lIDs[;1+io],<'** unknown **' [3] result>l[IDs[;io]<''fi x] (5=hemman cmdwsdrop arg;io;b;gl;i;last;lib;no;n;r;s;t;CMD1;R;noconfirm [1] )wsdrop pattern [2] 'arg' may be preceeded by an account number[:password] [3] io1 arg'/= /noconfirm' parse arg [4] 'pattern needed' signal(arg^.=' ')11 [5] find if there is an account number in the front: [6] nlib(1+arg' ')arg (^/b^\':'lib)10 nb/lib n: lib no [7] public libs are not to be signed on to [8] 10:lib(gl1vi n)/lib arg(lib)arg [9] STASKMODE'gather' [10] we signon to the other account if the account is >1000 or our account [11] signon,>1(x9991fi n)libai[io] [12] libstsend ')lib ',nogl/n [13] R 0 0 '' ('improper lib'lib)/100 [14] lib[b/blibCR]' ' libRmatrify lib [15] (0Rarg manymatch lib)0result'No ws to drop' [16] last1RR[avR;] i0 result'' noconfirm80 [17] 'Drop these workspaces?' fit R (/'yY'1)80 [18] result'Not done.' 0 [19] 80:(lastii+1)100 drop prompt from result [20] resultresult,R[i;],6stsend ')drop ',R[i;] [21] 80 [22] 100:CMD1av[4io],')off' [23] under SAM we wait for the signoff msg [24] (113av'')0 CMD1 p=1   cmd cmdwslib arg;io;ps;trap;b;gl;i;last;lib;n;no;r;s;show;w;CMD1;Del;Macc;R;SAM;STASKMODE;date;debug;er;lx;nofit;obj;public;sort;string [1] )wslib N with pattern [2] 'arg' may be preceded by an account number[:password] [3] /date will report the date, /lx its lx, /er its er[1;] [4] /sort will sort by =date, descending if (ex:/sort=date) [5] /nofit does not format result within pw [6] /obj= will look only in ws with any of those objects [7] /string= will look in ws with that string [8] If it starts with the output will be also displayed [9] /public will search public libraries [10] io1 [11] arg1'/= /date/debug/er/lx/nofit/obj=/public/sort=/string=' parse arg [12] [13] /public implies there is no lib # before the patterns [14] ps1 SAM113=av'' public2 [15] lib>(InternLibslib[2] [17] 12:nn matiota arg manymatch n [18] RR[n;] sort no other feature available w/ pub libs xcep /nofit [19] [20] find if there is an account number in the front: [21] 2:nlib(1+arg' ')arg (^/b^\':'lib)10 nb/lib n: lib no [22] public libs are not to be signed on to [23] 10:lib(gl1vi n)/lib arg(lib)arg any pattern AFTER the libno? [24] STASKMODE'gather' [25] we signon to the other account if the account is >1000 or our account [26] debug>,1(9991fi n)libai[io] [27] Rdebug/30,40,20,19 SAM18 scmdwslibR 19 [28] 18:R'R stop''cmdwslib''' syntax error on SAM [29] 19:debug>,objstring)60blast~i0 [38] r[2]30 prepare the string for [39] [40] uses a delimiter between strings to look for - we use '\' [41] See ' doc for details on how to use it. [42] r(2show)string Del'\' default delimiter; ensure result [43] r'+/,(nl 2 3)oss',1'''''',1'd',1((Del1r)/2Del),r [44] we send the statement to look for the string and return if it was [45] found (+/...) PLUS a statement to display the strings found IF [46] was specified before the string [47] debug>,,,? [66] 40:(0string)30 [67] b[i]'1'1rstsend string [68] (showdebug)>,<(n~CR,' ')/5w,n1r [69] 30 [70] [71] check if lx, er or date wanted [72] 60:RbR (erlxdate)sort s'saved''vered' [73] gli1 (last1R)100 [74] preset those sys vars in case they're undefined (SAM) [75] 70:rstsend 'lx''*** No LX ***''er''*** No ER ***''' [76] get the ws date and sys vars [77] r5stsend ')copy ',no,' ',R[i;],' lx er' get date in 'saved' msg [78] glgl,av[1],date/(4+(s>W1W [6] (0=10F)10 ((1F3,F)nums)110 [7] ((11F)>.2size 1 0 1 /F)120 fN,read F 40 [8] 10:(F^.=' ')20 F(F[;1]'')Fnl 3 [9] 20:F1(A1AF' ')/F,' ',F [10] 30:(F)0 '' fN(1+F' ')F [11] (3nc fN)130 (A1 fd fN)140 AfNA [12] [13] find fn name & display syntax [14] 40:fN(fN'')fN fN(-AA(32fN)' ',cR)fN [15] lN1+fNcR ' ',(B1+/(lNfN)';')fN [16] [17] remove fn name in header [18] ABfN fNBfN C(''A)A'' D'',CA result [19] DD,((+\B) 1 1 2[+/BB>1BC' '])/C' ',CA [20] D contains the header w/o fn or locals. fN contains the reset. [21] A'',D BA' '[1+(+/A' ')+3''A] where to drop [22] fN(BA),(lNĢ1+B+/(BA)'; ')fN [23] fND,fN,'' there may be spaces and a comment in the header [24] (C+/BfN'')50 A(C+C+fN)1 [25] A[, 2 0 .+(B/B)+2C]0 fNA\fN expand and [26] 50:lN(fNcR)^(fN)1fN'[' (/AfN'''')60 [27] account for text [28] A~A\AlN\D(-D)٢1DlN/\A fNA/fN lNA/lN [29] 60:(/AfN'')70 BAlN A~\B\A(-A)٢1AB/A [30] fNA/fN account for comments [31] lNA/lN [32] 70:BB(-B)٢1BfN1 start/end of tokens [33] (/BB\D(-D)٢1D(B/fN)1բ10)150 [34] AB^D\B lN(AlN)/A lNlN/lN lNlN-lN [35] AD/B A(A/A),1+A A/C(1A)-1A [36] A((C),A)(,C.A)\D/fN [37] C2'[:'.=(B>D)/fN [38] BA fN'' AA[B;] [39] D~^/A=(-A) 1 0 A ADA [40] lNlN[B] [41] CC[B] [42] A(0 4 + 0 11 A)A [43] D1D [44] 80:BD1 fN('i4' fmt BlN),' :?I'[1+BC] [45] fN1(E(-E)٢1EfN' ')/fN,fN,' ' [46] fNA[1;],fN (WfN)100 [47] 90:EW+1-((W+1)fN)' ' EfN [48] (W IS AN INVALID NAME OR NOT A FUNCTION AT THIS LEVEL' 150 [53] 140:'<',fN,'> IS A LOCKED FUNCTION.' [54] 150:F(F' ')F 30 [55] dANb 1992/05/05 20:55 =ʨ  ' Compare 2 workspaces or files DanB 1992 Syntax: ]compare [WS1] WS2 /ws /object=[]FN /load /nlines=N /zone=Z /show=S this command will provide useful information about the differences between 2 files or workspaces. *** note: destroys contents of active workspace !!! if ws1 is omitted then the active workspace is used to compare. /ws means argument specifies workspaces, not files /object=OBJ will compare only that function in the workspaces specified /load will use )load instead of )xload to bring the ws(s) in other switches: see below. the format of compare is as follows: the function on the left is assumed to be the one which has changed. the fn on the right is assumed to be the replacing fn. the output is based on these assumptions. each line of the fn on the left is preceded by its line number [xx]. where the line has been deleted a symbol appears '-' before the linenumber. where a new line has been inserted there is no line numbering and '+' appears. example: fna fnb [1] same line [1] same line [2] fna line 2 [2] fnb line 2 [3] same line 3 [3] same line 3 [4] comment deleted [4] new common line [5] new common line [5] new comment the output will look like this: -[0] fna + fnb [1] same line -[2] fna line 2 + fnb line 2 [3] same line 3 -[4] comment deleted [5] new common line + new comment note that in order to avoid lenghty output of big functions with little difference only sections of the function are shown, those where the changes occured plus a certain no of lines before and after. pw is used to delimit output output specifications /show=N1 N2 N3 (N) specifies the output format for each of the different sections: the unique objects in ws1, the unique objects in ws2 and the common objects in both ws. if NX=1 only the names are displayed, if NX=2 only their contents (or difference) is shown, if NX=3 both are shown. /zone=N will display so many lines before and after each different line /nlines=N will display the first N lines of each variable displayed those 3 switches also apply to the command ]compfile NOTE: this assumes that the 'compare' workspace exists in the same library as the file containing this user command.ommand.mand. =ʐmbbcjcCompare function in WS with the same one on file DanB 92 Syntax: ]COMPFN [>]object /FILE=ucmdfile /REP=var Will compare the objects with the one on a UCMD file. If a '>' precedes the name then all objects named in its group (ex. grpobject) are compared. If there is no source /REP may specify the source as in /rep=myvar (only good for 1 object).dd=Compare 2 character matrices DanB 84 Syntax: ]COMPMAT MAT1 MAT2 Compare 2 character matrices. See ]COMPARE command for details of comparison procedure.h=HQg Compare two User Command files DanB 93 Syntax: ]COMPUFILE UfileA UfileB Modified from APL*PLUS library. Compare the contents of the 2 files filesH=ʐmbbcjc ndaysdaysin ts;n;io;M;r [1] danb 83/9/14 no of days since 1900/1/1. rank 0 fn [2] rts ts 1900 100 100 ,ts [3] ndays365nts[io1;] [4] account for all leap years [5] ndaysndays+(n-1)4 [6] M 0 31 59 90 120 151 181 212 243 273 304 334 [7] ndaysndays+M[121ts[2;]]+(0=4ts[1;])^2, & = 99 del er;lx;trap;del [1] from '7 del'@ipsa [2] trap' 0 c signal 4er' (0=nc '99')/'99''''' del(99,' ')[io],01er (del(names^.=' 7 del ')/nums)l0 '7 del' stie del((50)0,nums)0 [3] l0:99('Tn' pack del) pins('Rc' pack 0) pins('Buf' pack 99) pins('Name' pack er) pins 'Qio' pack io pdef read del,6 er'' [4] l1:trap' 0 c ',l3 lx'',l4 (0=10'Name' pval 99)l2 9999 pins 'Typ' pack,4 9999 pins('Typ' pack,2) pins 'Rnp' pack read 'Name' pval 99 l3 [5] l2:9999 pins 'Typ' pack nc 'Name' pval 99 9999 pins 'Rnp' pack1((3='Typ' pval 99)/'''1 fd'''),' ',((4='Typ' pval 99)av),'Name' pval 99 [6] l3:del ('Rc' pval 99)l1,0,l6,l8,l9,l12,l11,l14,l15,l5 [7] l4:9999 pins 'Rc' pack 9 l3 [8] l5:'Arg' pval 99 [9] l6:'Arg' pval 99 ('Mfl' pnc 99)l7 er [10] l7:9999 pins 'Rc' pack 1 l3 [11] l8:er,5 ws 'Arg' pval 99 (er((1=1er)2=er[(er0)1])/'incorrect data type')l3 9999 pins 'Val' pack'Arg' pval 99 l7 [12] l9:er,5 ws 'Arg' pval 99 (0 19 =er 0 19 1[(1 0 =(1=1er)^ 0 2 =er[(er0)1])1]'incorrect data type')/l10,l3 (er('Mfl' pval 99)/'not without rep')l3 [13] l10:('Arg' pval 99),'''Val'' pval 99' l7 [14] l11:er3 fd 'Rnp' pval 99 (er(0=10er)/er)l15,l3 [15] l12:('Rnp' pval 99) replace 1fi 'Name' pval 99 l15 [16] l14:('Name' pval 99),'''Rnp'' pval 99' [17] l15:('Tns' pval 99)l17 (1<'Ord' pval 99)l16 9999 pins 'Rc' pack 5 l3 [18] l16:names[numser;] erase er'Tns' pval 99 [19] l17:untie 'Tn' pval 99 996 12 1 =&;;8 71Display Function on Top of Stack DanB 2002 Syntax: ]dfts [lines] The function of the top of the stack will be displayed completely if no lines are specified. Lines can be selected using regular APL expression that can include keywords "to" and "all". For example: ]dfts 0,3 to 12 ]dfts all~7 to 13,19 to 230=4600 0Display enclosed array with boxes DanB 2002 Syntax: ]display array This is the equivalent of APL+Win's ]DISPLAY user command. It displays an array with boxes surrounding each element.915=Download file to PC using ASCII translation DanB 1996 Syntax: ]download [lib] aplfile /tr= /file= /fn= /var (SAM only) This command will take an APL file and download a copy to your PC. The "aplfile" may be the number of a file already tied or the name of a variable (or niladic fn) in the workspace in which case the /var switch must be used. It uses the HDSIO/PC108 functions to do the download. The file created on your PC will have the same name, in your current working directory (usually where [X]RC108 was started) unless the /file switch is specified with a value. A full path may be supplied. Each component of the file will be made into character if numeric and tables (matrices) turned into CR delimited lists (vectors) before any transfer to the PC. Packages won't go through and WILL create problems. Translation is ASCII and CRs are turned into CR,LF. One such pair is sent between each component. If a different translation is desired use the /tr= switch to sax, stsc, none or ipsa (default). If a special function has to be run on each component it can be specified with the /fn= switch in which case nothing is done to any component by the command itself and no error is trapped. This is for adventurous souls only. Examples: ]download myfile goes to on PC ]download 666 /f=c:\temp transfers file tied to 666 to c:\temp ]download myvar /var transfers contents of 'myvar' to ]download 1234567 abc /fn=myfn /file=f:\user\public\lookthis.at /tr=sax assuming <1234567 abc> is accessible each component will be passed on monadic fn in the ws and sent to the PC file specified using the 'sax' translation.=ʸSame as ]UEDIT with /F=file option and same spot replacement DanB 92 Syntax: ]ED object /file=ucmdfile /stop faster than ]EDIT. Will also work on objects on stack (SAM only) and different files. It may be subject to growing replace problems. It does NOT update the 'LAST MOD' timestamp. /stop allows to stop the fn to use your favorite editor or apply custom changes. When ready to file back simply 'lc'. NOTES: it will destroy the object in the workspace if it exists. It does not work on packages or locked fns. Under Unix/Linux the editor function is not available and the EDIT editor is used instead. This means that the ]ed command won't work directly in an S-task. To circumvent that problem use the "run in parent task" escape character "&" at the end of the command as in ]ed myfn& of course you can always use the /stop switch and use the )edit feature of the 'stask' workspace. Just don't forget to 'lc' if you're happy with your editing. :) E T=j rfactorsof n;f;io;p [1] DanB 19970918 prime factors of n [2] io1 r'' signal(n(pPrimeList)*2)16 [3] l10:(0=f(0=fn)/f1ff/f(n*0.5)fp)end [4] we now know which numbers divide n. there may be multiple instances: [5] ok, tack on the rest [6] rr,f [7] (1=nn߫/f)l10 no, divides perfectly [8] rf,factorsof n [9] end:rr[rr,n] =eeibsFind factors of a number DanB 1999 ]factors 321 will find the factors of 321, namely 321: 3 107 3 107=ʐ& /skDecode file access codes DanB 9602 Syntax: ]fdecode [nkeywords] /reverse This user command will return the code associated with access keywords like read, rename, fhold, etc. or the keywords associated with a code like 131070. The /reverse switch will show the keywords or the code(s) NOT associated with the argument. For example ]fdecode read copy 131073 ]fdecode read copy /r 131070 ]fdecode 131070/r read copyl'@T=Є""W@( rwidth fit MAT;io;W;P;F;DIM;width [1] dANb 840614 RESHAPE CHAR MAT TO FIT width. [2] W:WIDTH; F:NO OF FOLDS; P:PAGE LENGTH [3] io0 [4] (0=nc 'width')/'widthpw' [5] FwidthW1DIM 0 1 +MAT [6] DIM[0]FP(1DIM)F [7] r(P,FW)(F,P,W)DIMMAT or= rcFit argument on width 80 (default) or as specified by /WIDTH= switch DanB 92 Syntax: ]FIT expression /WIDTH=[80] Fit argument on width 80 (default) or as specified by /WIDTH= swit= switc=О[27]Show files in library with patterns DanB 95 Syntax: ]flib [lib][patterns] /nofit /cd= /md= This will produce a display max pw wide of all files if pattern is blank in the (personal) library. A list of patterns may be supplied. Result is any matching the patterns. Ex.: ]flib 1234567 B* ** ??*8 /nofit won't display columnwise /cd=date will retain those created after the date given /md=date will retain those last modified after the date given Dates must be supplied in yyyymmdd format.ormat.=xWWum[zShow functions in workspace with patterns DanB 95 Syntax: ]fns [patterns] /nofit This will produce a display max pw wide of all functions if pattern is blank in the workspace. A list of patterns may be supplied. Result is any matching the patterns. Ex.: ]fns B* ** ??*8 If /nofit is supplied the list is returned unformatted. =(h( EXP fori N;F;M;i [1] i''N2io,N-io<1=,N 2iN1N [2] M8,EXP [3] Mfx(3,M)(M'F'),(MEXP),M'Nii+1' [4] F [5] danb 83/9/27 will EXP for i:=N[1](or io) to N[2] n=ʠ)/tExecute expression for I:= IO increasing N times by count DanB 83 Syntax: ]fori expression /i=Ixpr Execute expression containing I as looping variable /I= limits[,count] Long command. Does not need quotes to show where the arguments are. Execute expression for I:= IO increasing N times. or from n[1] to n[2] increasing by n[3] (default 1). Example: IO1 ]fori READ Tie,i /i= 10 will read first 10 components ]fori i,10*i /i= 2 5 display 10 exponent 2 to 5 ]fori Fn i /i=10 5 2 execute Fn10 8 6 NOTE: argument taken 'as is' up to the presence of '/i=' within expression. Although I is available as a variable it does not remain in the workspace upon completion.etion.= ""ONE Show RDCI of the components of a file DanB 95 Syntax: ]frdci file /start= /skip= /end= /lock= /empty The file's (name or tie ) components information is listed starting at the beginning (or at the cpt specified at /START) SKIPPING every /SKIP (default 0) until the end (or /END). If /EMPTY is used empty cpts are shown. If a password is required /LOCK can be used. Display shows file name, size, file information, components in the range requested from start to end. Component number is shown followed by colon (:) if preceeding component was empty. /start and /end may take a sign as in /start=-12. A '+' means after the first component, a '-' means before the last. Ex.: ]frdci myfile /start=-20 to show the last 20 components ]frdci 1001 /end=+12 to stop after the first 12o= 6.82 Read a component from an untied file DanB 2002 Syntax: ]rfread [lib] fname component /keeptied The file will be opened, the component read and returned as result. If the /keeptied switch is set the file won't be untied after the operation.0 =mmanReferenced globals DanB 92 Syntax: ]GLOBALS fn /FULL /FUN /VAR /FMT /UPD This command will produce a list of a function's global references. It will allow to see the names of objects which are referred to globally. If the /FULL switch is supplied the globals referenced by sub-routine calls will also be shown. If the /FUN switch is used ONLY, the objects referred to are visible FUNCTIONS only. If the /VAR switch is used ONLY, the objects referred to are visible VARIABLES (or unknown) only. If the /FMT switch is used, the result is shown in readable format. If the /UPD switch is used, the result is inserted in the function. Note that is being taken in account but that its use may not be interpreted properly. Text in functions with is scanned between the character and the next character on each line where it appears only. Same applies for ELX and ALX. 0 \$ Mx   L'(-4/,7D:ABC,EILNOPhQR,Un@ptq\rDtvwx{T<D<  ll  L\t| t D!#& ()*+D- $8<>LBEJ4LStWi knot$  4||tT<,t< ,,|$TDl$,=cmdaccess pkgstask=@ cmdaddr addr=Ph` xTREEGENcmdcallsxC1 xCOMPARExDF xEQ xFr xFT xGENSYMBxMV xQZ xRD t= timen to= CLEARFILE COMPAREFILESsvm COMPV COMPACK COMPBOOL COMPFN COMPIND COMPVAR DISPLAY FIT FNCR JDMR1 MCOMP UNIQUE VM cmdcompare pkgstask N=H::addr crfromvr COMPFN MCOMP COMPBOOL COMPIND UNIQUE JDMR1CM=д**parse COMPBOOL JDMR1 COMPIND UNIQUE addrx;=ʸ OOdcmdcompufile crfromvr COMPFN MCOMP COMPBOOL COMPIND UNIQUE JDMR1 ftimerep fitp fit=ʸP shadowed=h@to=|cmddownload pkgpcxfr,L4<,l,4<$<<4$,, T $ < $ D\<,T&)t-/01 =,E P ]|^c%XhE8vDp4l|<LT\<Td<|  | Td,\D \$ + 6 HMRUp }=ʀladdr nc ohl del=--cmdfactors parse isprime factorsof PrimeList=fori tstofl fit patmatch=##cmdfns wsnl patmatch manymatch fit=8Ttimefmt cmdfrdci=ʸ MMdparse xMV xC1 xCOMPARE xEQ xFr xFT xGENSYMB xQZ xRD xTREEGEN fit allfns xDFs xDFit=pHtimen daysin IDs=patmatch fit cmdnamesnames=""parse xFr xEQ xC1 xRD xMV xQZ xFTs=G ohl allfns=!!fit osr os remshadowed pkgmatch=!!oss os remshadowed pkgmatch fit=cmdprtlines pkgprtlineslines=ʰ/ parse osr=ʘ@osr=ʀobjdata ftimerep=ʈ cmdtimefmt timefmt=H66cmdtref xFr xMV xC1 xEQ xRD xQZ wsnl remshadowed fitd fitM=( fit fori oss=$$cmdvars wsnl patmatch manymatch fit=ʀ cmdwhois IDs=X ))cmdwsdrop pkgstask fit patmatch manymatchE(=0CCcmdwslib system InternLibs ProdLibs fit patmatch pkgstask manymatcht=ʸYass Show hexadecimal equivalent of argument DanB 93 Syntax: ]HEX n1 [n2] [...] /BACK /CHAR Show hexadecimal equivalent of argument. /BACK will work backwards (from hexa to decimal) and /CHAR will work assuming characters (as opposed to numbers). Example: ]HEX 16 256 0010 0100 ]HEX 10 100 /BACK 16 256 ]HEX 16 /CHAR 0031 0036 UCMD 'HEX 41 36 /BACK /CHAR' A6 Note that the /char switch is based on av.=ʨ;(Manage workspace history DanB 940328 Syntax: ]HISTORY comments /VERSION=n.nn Updates global variables 'VERSION' and 'HISTORY' by adding the comments to the 'HISTORY' global along with the date and the version number. /VERSION may be a new version number or an increment (like 0.1). =Input text input a variable DanB 92 Syntax: ]inputxt var The command will accept input until 'space,CR' is entered. 'var' will contain the text entered.re.h=ʰt}}j risprime n;pl;max;io;in;lg;pn;div [1] DanB 19970918 is n a prime number max (PrimeList)*2 [2] io1 r(n 2 3)0^.r.nr2,1+2/0.5n*0.5 [3] innmaxplPrimeList rin\pl[in/n] (/in~in)0 easy part [4] signal(max is searched for all globals and fns called. The ws is then cleaned of the unneeded objects. NOTE: this won't work if or error handling thru comments are used. used.=ʀm}}Return list of LOCKED fns DanB 92 Syntax: ]LOCKEDFNS (no switch) Return list of LOCKED fns. Result may be captured.tured. =HjhLog message to file Syntax: ]log string /keywords= This command will append keywords (default 'activity') and string to file on the actual account. The file can later be perused using command ]monitor.=`55 rpat manymatch list;io;n [1] return list of objects matching several patterns in list [2] io1 [3] pat1(r1rpat' ')/pat' ',pat remove excess blanks [4] r0list patterns are delimited by blanks [5] l10:rrpat[ɢ1+npat' '] patmatch list (patnpat)l10 [6] r(r)r =nDisplay contents of file Syntax: ]MONITOR range /DATE /FILE=file /WS=substring /USER=userno /APPLY=fn /WAIT /STRING=string /NOWS This command will display the contents of the file in the 'range' requested (none=ALL) for the file specified (default ai[1] MONITOR). Several filters can be applied. The text may be scanned for a specific string, the user specified (none=ALL) and the workspaces containing a specific substring. If /DATE is used 'range' is assumed to be dates in YYMMDD format as in ]MONITOR 930212 930217/DATE. Y or T are surrogates for Yesterday and Today as in ]MONITOR Y. If /WAIT is used the program will WAIT for incoming messages and display those which match the filtering process. BREAK exits the program when WAITing. To reverse the filtering use '~' (see example below). By default the display shows a line with the first element found in the component, assuming it contains a workspace name, then the rest of the component following the filtering rules. If no such workspace info is there use the /NOWS switch. By default also, each component displayed shows the timestamp of the component and the user number that filed it. Variable 'IDs' in the ucmd file is a 2 column table of accounts & userids which is used to display the names instead of the accounts. Examples: To see the first 21 messages in the default monitor file do ]monitor 21 To see all the messages generated by user 5595010 from a workspace containing 'INPUT' in its name enter ]monitor /ws=INPUT/user=5595010 To see all messages from workspaces containing 'crash' in their name from user 1234567 but NOT containing the string 'test', from file XYZ since yesterday do ]monitor y /ws=abc/u=1234567/st=~test/f=XYZ To see all of today's messages from a file without ws info and wait for more incoming messages (checks every second or so): ]monitor t /nows/wait To see all messages between two dates, applying our ws resident fn to format the message (or do anything else with it): ]monitor 20020501 20020601 /date /apply=fmtmsg To see a maximum of 12 lines of each component containing matrices do ]monitor /apply=12 max=12 max12 max=ʠZ]unames with pattern DanB 96 Syntax: ]names pattern1 [pattern2...] /file= This command will show all the names in the file following a specific pattern(s). Patterns are loosely resembling DOS' patterns except that they are more intuitive. A pattern consists of constant letters and "wild card" characters '?' for ANY single character and '*' for multiple characters. Example: ]names abc* show all names starting with 'abc' ]names *abc show all names ending in 'abc' ]names p?? show all 3 letter names starting with 'p' If /file is not supplied only the first UCMD file is searched.l lo=@XXno nChange local names to 1, 2, 3, ... DanB 93 Syntax: ]NOCLASH fnname /STEM=stem /N=nn where 'stem' is the section of the variable name to remain constant Change local names to 1, 2, 3, ... Example: ]NOCLASH MYFN /S= will make all local name to start with '' instead of ''. Notes: IO sensitive. Names will start at 0 if IO set to 0 AND /N not used. Only labels and local names are changed. If the function comments contain the string '~' any name following will not be changed. Ex.: rF b;IO;x;CR [1] x3FD 'xCR y',cr,'[1]xCR y' ~ CR [2] rCR b MSG'done' IO0 ]NOCLASH F /S=X will change to (order may vary) 1FD'F' X0F X1;IO;X2;CR [1] X23FD 'xCR y',cr,'[1]xCR y' ~ CR [2] X0CR X1 MSG'done' not= ppReturn list of objects used by argument DanB 92 Syntax: ]OBJECTS /FMT /SORT This command will return a list of ALL objects referenced along with their TYPE. Result may be captured. See command CALLS for meaning of TYPE and result. /SORT will sort the result using AV sequence /FMT will separate TYPE from NAME and make the result fit pw.L fi=ʰ rohl fn;cr;m [1] oRDER hEADER lOCALS [2] m1<';',(-rrm' ')m,1crcr fn cut line 0 [3] m(r)1>m[io,1+av 1 1 >m] sort [4] cr[io;]m rfx cr r ea=ʸreOrder Header Line of a fn DanB 92 Syntax: ]OHL [fn] Puts the list of locals in alpha order. If is not supplied it is done for the entire workspace.space..=ʐ+ g g 99osr osr Sr;98;AlL;HiD;ReP;SrH;io;0;1;2;97;96;95;94;mV;93;Po;Pu;92;91;90;89;lU [1] io0 (nc 'osr')/88 osrnl 3 [2] 88:(930101osr)87 97211,(,1)20,(2size 11),1 97[2]1[2]2[2] osr97[3]-910,97[3],0 86 [3] 87:osr1(111osr' ')/osr,' ',osr [4] 86:99'arg length error' (20(95/95Sr1Sr),Sr)/0 9012 2 11 'BTCALR=;INbtcalrin'10[1]Sr 99(~2[6])0 (^/2[7 8])85 AlL'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' AlLAlL,'0123456789' 94fx((94)'RS Po P;T'),[0.1] 94'SSPR\S\T10,TS/P' 94fx((94)'RS Pu P;T'),[0.1] 94'R\PS\T10,TS/\10,P' 94'io1l1l-1+1l(~d)/ddmv,d1vm(d)(,dl./l,d0)\d/m' [5] 84:94fx((94)'mmV v;d;l;io'),[0.1] 94 2[9]83 lU 2 26 AlL 94'bb/br[b]lU[0;lU[1;]r[b]]' 94fx mV 'ruP r;b(/brlU[1;])0',94 95[0]0 9795/97\95 Sr[97]uP Sr[97] [6] 83:89971,'',[0.1] 2[3]/'btc' (Sr(111)/10[1]Sr)85 1(10)-101-11-1110 94'bctt>cl Po(m'''')>ttl Pu tm''''''''' 2[3]82 9494,'a(9''trap''a)(''nc''a)(''ws''a)''''=a,m' 9494,'bctt>(lb^m'''')Po a' [7] 82:95'rv HiD m;l;c;t;b;ar1lm=av[156]v/2rr',97 95(/2[4 5])/'S1~TAlL' 96(2 12 /2[4 5])/'^S^(1+1[I])S' 94'Rv SrH T;M;s;Z;N;S;IR0 2I0N1Mv HiD T',95 9494,(/2[7 8])/'s11s/sT=1T' 9494,'L:ZSr[0[2I]+1[I]]',(4~2[9])'uP T' 9494,(/2[7 8])/'(',2[7]'~/sZ)E' 9494,'ZZ^M',96,'RR,[0](Z/Z),[.1]I' 9494,'E:(N>II+Z1)/LRR[R;]' 96fx mV 94,'l:(^/S\Z10,1[R[;1]]+ZR[;0])/0RSRl' 94'l22[Wp[;1]]l1(1,0)[W]k(b,t)-0,l1+bp[;0]b(2k)1 0t((,k,[.1]l1,0)/b)/tt((,k,[.1]l2,0)/b)\tt[b+l2/+\1k]Sr[(b+/l2)+l2/0[1+2W]-10,+\l2]' 96fx((94)'tp ReP t;k;l1;l2;b;W'),[0.2] 94 2(2,0.51)1 12[;0] 22[;1] 93/81 [8] 80:(osr)85 (922nc 95(osr' ')osr)/79 981 fd 95 [9] 78:(096''9492 SrH 98,av[156],98)/77 [10] 9894 ReP 98 92/76 [11] (949999+9694~0103 fd 198)/77 'NOT ',95 77 [12] 76:922>97 989298 92/75 [13] 9498((197),194)94mV 98 [14] (0.>9297-94)75 (0' '=(97(-97)1)98)75 989298 [15] 75:9999+96 93/74 95,'dEf' 77 [16] 74:98 replace 2osr 81 [17] 79:9895 [18] 73:(2pnames 98)77 (' '1098)77 9798 78 [19] 77:93/81 osr(1+95)osr 80 [20] 81:(/1osrosr+91)/85 98read 2osr 73,921 [21] 85:(99)0 99(99),' replacements made.' ' =Object Search and Replace DanB 87 OSR: Object Search and Replace Syntax: ]OSR str1 repl1 [str2 repl2] [... ...]/X=bct;/A/L/R/I/O=obj/F=file Switches: See command OSS for details. This is command OSS counterpart. This command will search AND replace. Examples: ]OSR abc xyz replace 'abc' by 'xyz' everywhere ]OSR abc xyz /L/R same but for both left and right strings, in other words for the exact element 'abc' with no number, , , alphabet or around it. ]OSR abc Z999 /X=C replace abc by Z999 everywhere except in the comments ]OSR filA filB /X=BC /O= Fa Fb replace all occurences of filA by filB in the quoted text only of functions Fa and Fb. ]OSR x y y x/L/R/O=>F swap all occurences of 'x' and 'y' names in function and its called functions. ]OSR 'C/L' 'L IF C' replace all those occcurences everywhere. Note the use of quotes to enable the replacement of slashes and spaces. Restrictions: See command OSS. Comments: Large functions are more likely to create problems than smaller ones. Replacement of quotes (') WILL create FiXing problems. Syntaxic search is based on not having any of the name forming characters around the string to search. Using '/A' switch slows down the program dramatically. Shape of variables almost always changes as the lengths of replacement strings differ from their originals. Using /X=BCT/A only makes sense for functions or variables holding CR (1FD) of functions. Note that in the latter case the line numbering is also subject to replacement.=1  99 99oss oss Sr;AlL;HiD;SrH;io;0;1;98;97;96;95;94;93;lU;mV;92;91;90;uP;89;88;Po;87 [1] 96io0 (nc 'oss')/2 ossnl 3 [2] (920101oss)3 979811,(,1)980,(2size 11),1 97[2]1[2]98[2] oss97[3]-930,97[3],0 4 [3] oss1(111oss' ')/oss,' ',oss [4] 0(94/94Sr1Sr),Sr 911698 2 12 'BTCALR=;INPbtcalrinp'10[1]Sr 88198 99(0,91891++/94)0 890 89971,'',[0.1] 98[3]/'btc' (^/98[7 8])0 (Sr(111)/10[1]Sr)0 1(10)-101-11-1110 AlL'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' AlLAlL,'0123456789' 94'io1l1l-1+1l(~b)/bdmv,d1vm(b)(,bl./0,bl)\b/m' [5] 94fx((94)'mmV v;b;d;l;io'),[0.1] 94 98[9]6 lU 2 26 AlL 94'bb/br[b]lU[0;lU[1;]r[b]]' 94fx mV 'ruP r;b(/brlU[1;])0',94 SruP Sr [6] 94fx mV 'RS Po P;TSSPR\S\T10,TS/P' 94'bctt>c\(m'''')>tt\tm''''''''' 98[3]7 9494,'bctt>(m)(,1,0 1b^m'''')' 9494,'Po(''ws''a)(9''trap''a)(''nc''a)''''=a,m' [7] 94fx mV 'mHiD m;c;t;b;a',(89/94,'m~',97),(~89)/'m1' 94'rSrH t;h;m;s;n;S;i;w;trap(0st)ri0',91/'r0' 9494,'mHiD tn1trap''0 e er0''' 95/98[4 5] 9494,(95/'S1~tAlL'),'t',(98[9]/'uP'),',t' 96/98[7 8] 9494,'l:wSr[0[i]+1[i]]rr',91'',91/',+/,' 9494,96/'(',98[8]'~1s[1]h)^h' 96(1-98[11]96)96'OSSPATMATCH' 9494,(29189)'m^(sw ',96,' t)',(98[4]/'^S'),98[5]/'^(1+1[i])S' 94fx mV 94,'(n>ii+1)/l',(91<89)/'rr^m' 92/16 [8] (0oss)960 (872nc 95(oss' ')oss)/12 97cr 95 [9] (+/,94SrH 97,''av)15 9694 9115 98/94 96+/,94 0 1 9894 (199)/15 90(2 6 ' VAR ')[87;],95 9210 90(2oss),':',(-878790' ')9097[0;] [10] '' 90,' (',(96),' found)' 90-+/^\' '=979897 [11] (,'p<[>q<]>i5,x1' fmt 981),90[0]97[0;] ' ',(90[0]94[0;])\'^' (094 1 0 94)/15 97 1 0 97 98[981]0 90190 11 [12] 9795 [13] (2pnames 97)15 (8894' '1097)15 (88>94)14 9797 [14] (297)/9 97mV,av[156 10 13[112 200 av'']],97 9 [15] 9999,[0] 96 92/16 oss(1+95)oss 8 [16] (/1ossoss+93)0 97read 2oss 13,9587960 =1  t SeObject Search String DanB 88 This command will scan for the strings given as argument in the ws. It can be restricted to specific object names and conditions. Syntax: ]OSS word1 [word2 [...]] /L /R /C /N /X=bct; /A /O=object /F=file Switches: /L Left syntaxic search /R Right syntaxic search /X=eXclude Body of fn, Comments, Text, local(;) or non local() text /A APL mode: Body includes text to the right of ELX, ALX , /O=[>]NAME1 [NAME2] ... to limit Object search list /F=filename will search the file instead of the workspace. Tie number may be supplied instead of filename possibly followed by start/end components. /C Case insensitive /N Non-character (numeric, eclosed) variables to be searched as well The search can include/exclude the APL statements, the text (between quotes) and the comments. It can also do the search syntaxically, either to the left, to the right or both as the switches specify. If global references are wanted use semi-colon (;) as argument to the eXclude switch. If local references are wanted use quad () instead. It operates on all functions in the whole workspace but can be restricted to specific objects, functions and their calling tree or variables, or each character component of a file. The function uses local names which may clash with the names to search (see the function header) and will operate more or less rapidly depending on the type of search in effect. The /A (APL) switch modifies the behaviour of the /X (eXclusion) switch in the sense that text that would be executed ( or ELX...) is considered code. Examples: ]OSS abc show all occurences of abc everywhere in all functions in the ws ]OSS abc/R show all 'abc' right ending strings. ]OSS abc/L same but for left starting strings ]OSS abc/L/R same but for both left and right strings, in other words for the exact element 'abc' with no number, , , alphabet or around it. ]OSS abc/X=T show 'abc' everywhere except in the text ]OSS abc/X=cT/A show 'abc' everywhere except in comments and the text which is not considered APL code (like ELX'abc') ]OSS Sharp/X=BC/O=fn1 test show all occurences of 'Sharp' in the quoted text only in the objects 'fn1' and 'test' ]OSS x y /L/R/F=MF show all occurences of 'x' and 'y' names in file ]OSS 'l if c' 'c/l' /X=C /O=>SFN /C search for strings (ignore case) which include spaces and slash outside of comments in fn and ALL other fns it calls ]OSS 1.05 /O=NL 2 /N search '1.05' in all variables, incl numeric Restrictions: Large functions are more likely to create problems than smaller ones. Syntaxic search is based on not having any of the name forming characters around the string to search. The ability to search the calling tree depends on having the user command available. =Ph__mandShow packages in workspace Syntax: ]packages Return table of names containing packages.ages.=s)98 rp patmatch t;io;b;d;i;j;n;B;M;S [1] dANb 950202 pATTERN mATCHING A LA dos BUT BETTER [2] 't' is the text table shrunk as we go. 'r' is resulting matches [3] normalize pattern like ?*?* to ??* (** is reduced to *) [4] io0 rt S'?' M'*' [5] p1n[i]ib+(,1b)/100+/2=b'*?'n'.',p [6] b1,(1b)1bM=p,p pb/p [7] Bt' ' B is Blanks, S Single char NOT Blank, M Many S [8] chk if * only and exit else grab chars up to * and goto many if 1st * [9] l:(p)N dp[0]M (pdp)0 npM bSnp ib/n dmany [10] SIMPLE PATTERN: all chars must be non blank & non ? must match [11] t(0,n)(d(/B[;n])[[Y @  (*9s:D)p;"< @@ (rbye time;t;trap;io;k;f;m;;ts;ec;dir;b;c] @8l( time can be [[[[YY ]MM ]DD ]hh ]mmnto8(Q(t(fitime), 0 0 bye((K( timet,(t)ts( (io0k123 Fn 0( tk fstie PunchCardsFileb;cr0HX (trap'21 e (1e4+12size t,k)resize t,klc' E(H((R(dirread t,1,k nch(0( (/b<\dir[;0]1ai)no 0 ( c2+b1 R(fholdt,k 8 (( mread t,c,k (h^( r'not in yet' ( ( (21m)no J( mmtime P]  b12, 0 60 60 1000 --/ 0 12 31 24 60 60 1000 1ۢ2m fPH,(r'out time out of range. Last time in: ',2,1٢2m (H K( (/b<0,24)no (*(m replace t,c,knchort(8(r'ok, been here 550 hours 50 min'h8 )(no:untie t 11 8(:>fstie)arg(''' (=! pi(n; 02AT dHTEpt'xtun.  ul( eshrmtter0ȸ (>jsl 0(Q(r fstie ;trap;io(XH( stie the file and returns the file tie no. or 0 if unsuccessfulX@( rscalar if file previously untied or 0@8Q( is an optional file pass numberFno8 (io1 8( trap' 24 e tied 0 e r0']mmnto8(Pc((0=nc '')/'0'(0(( stie(r((20)nums)0), 00,( 0(*(tied:(1 0 vi )l1e(0(((101ai),' ',11 0( l2@(l1:(101fi ),' ',11(1+/5486av)@0ȸ(l2:r1((names^.=)/nums),00the  Xp@hi [5``d ti(=! X[6d ), e(mPmt 8],2 ee8utX00ml nt t  [1@/d>(n@ (* s:p"<;b;c [1@8l(rhi;t;trap;io;k;f;m;ec;b;c;dirdFnto8 (io0k123 Fn 0( tk fstie PunchCardsFile 0 0HH(trap'21 e (1e4+12size t,k)resize t,klc'E(H((R(dirread t,1,k hi(8( (bdir^.=cai[0],2ts)/repl erFno8 x( dirdirci (h^(dir replace t,1,k(0x(c(m 0 7 0) appendr t,k ,20( add (repl:c2+b1 @ h( mread t,c,k (Pc(add:(21m)1+add ((Q( r'not out yet' l1e( ( untie t 8( 0(mmts(K(m replace t,c,k '( ( r'hi' ]  ( untie t= p[;0(clacepresence(1xxunt,(=!et(rop tpppH xm)taiee P Fi  ,P .= b)X m8 ((CDE F'"IG8H(dtdet presence aym;a;ym;io;m;n;e;t;d;b;tie;PASSrE(HPp  PASS1111 Account, Year, Month; det is details (no grouping);P(io1 8Q( dt 0 2 0ppdef 'det' pack 0 dFno88(aym((-aym)ai[1],2ts),aymfiaymo80(tiePASS fstie PunchCardsFilem,0(h^(dread tie,1,PASS 1e( ( bd^.=aym dFn H( (/b)end 0h(mread tie,(1+b1),PASSt((360@(e0.5n1m(-21m)mmts get schedule@@(t--/(e,2)tstamp m time between in and out[1@@И(d100(n 1 0)m[;3] all dates of entry)@ X(dtd,[1.1] t  ]( detend{@ HH(dt(n/d),01>(nd10,d) 1[99]9999 a [YY]YYMMDDX0(io0ppdef 'det' pack 0 1000H(rangerange100*13>rangerange,(0=range)/ts[1]nE(H8(m0.01rangerange+0,310=100͢1range8@( 'det' is details wanted along with sum50 hou@0(s'F' any other fn will do3600X ( 'range' may be 1 or 2 dates0(X(l2:p0 presence m[0](8( gather all info for months in range 8 (l5:(>/m)l10 ( mm+ 1 0 @ (Pc( pp0 presence m[0] (( l58( 'p' is a 2 col mat of dates & times)8(h^(l10:d10000p[;0] e1e(0x( p((drange[0])^drange[1])p0 (n1p 8( m+\p[;1]360060 'm' is cumul hours80h(pp[;0], 0 60 p[;1]3600ng);0 P(r11mH 5(det0@(F'5555_55_52: 550 hours, 50 mins (550.0)')@0(ppn,, 0 60 60(1m)nm08(mm,0 pp, 0 0 60 sm mm, 0 01]8 (l99:rFp,m av[0(0tstampe1e(HbКp(=!rp pt321li8liptparp(0 (L0]( 8(ttstamp r;m;y @( converts ts timestamp into rdci format f@ x(y11 r @ 8 ( m1111 r p(t((365.251960+y)+ 60 29 1 30 60 91 121 152 183 213 244 274[m-~io]-(0=4y)2m),21 rp(Pc(t 1 1 24 60 60 60 t(slib0(#nPunchCardsFile0((Q "b punchcards (=VVs x@h0X Hp8`(Px@h0X H p  8 ` ( P x  @ h  0 X  Hpx(  (((((se9] ((l](l, ((oice*@*h((zi(<<((mskFG((Q@Qh((Xata ZZ((Xmm((P pvazz((read~~@(((( (( ccesHp((8vU(P((( step((gene((( pȘ((( ؈ذ((gene@((X  ((U((step8`((8`((h((((x/ ( H((/step p ((UHp(( gen##((x/pac'((()0)X(( ,-((x[cnt:; ((ffixCD((2itiaEE((x(LeKL((Xtr VV((+\Q0Z@Zh((,Lnmsp0pX((ss((R((hR85)((  0 d((@h((R 0 dx((R/92((mm/0P((am\s((ؒU((@ ((P0Hh((((P((R((P0P(((( ((h 0((hR`((R((P H(((p((/(( p((((x(({0X((,p((((((h(H(( b`((((((h @((X((@-((((& H((ah((((t zi H((3 ccx(( ber (() e , argstrE((3@`@@x(=!0xet d8mai,aox(me cU'\DD ]hh( (zargstr n@dFn X2s convert argument code into character string expression yieldingchX }( argument@ P0(nHH(l0:z'F',n yes, generate reference to step functionHH(`(`vUbldalt;]' (trero =!r (d,P ferhaff@Q1 eqH or l  atP sc cfrrenP fper] rQN(`v (UOPme), 0((H(zbldalt Tree;t;Stk(0ph( generate alternation tablerbo0 (P 1s - alternation path table, an nm integer matrix.d\staPX the first column contains tagged step numbers which arechXXar descendants of one or more alternation nodes. the remainingQXX)1 columns form zero-padded vectors which represent encoded pathXX  information for reaching the tagged node. each vector is1,m)XX[2] comprised of a list of node numbers which are alternationrom XXeml nodes. if the sign of a node number is negative then the [XX lg tagged node belongs to the left subtree of the alternationor XXrs[ node. if the sign of a node number is positive, the tagged XXdem node belongs to the right subtree of the alternation node.latX(8v(StkQ0 initialize empty stackk dFn8 H}(tQ1Tree Fn 8 t(~tTree[; 2 3])/t get root node(8H`x(z(0 1 Q0) bldalt0 t recursively build alt tableHe (o(bldalt0tor t(l r in`r=!mp` emre`ofpr[2 8ep]  su s` [2 g in haX f ea eachHsph f c[28iXp,p,mop,`8U ($UURte ma8(`(zz bldalt0 ptr;t(H( recursive function for building the alternation tableHXV( called from the function , where the globals and X l( are set up.n 8p(ptrptr pointer may be negativedFn8XHW(((Stk)^Tree[ptr;Q4])l0 is stack empty and is node tagged?gged X(x(t(Q1z)Q1+Stk (P1t z(((Q1z),t)z),[Q1] tptr,Stk add entry to result15] l2:P@Y(l0:(7=Tree[ptr;Q1])alt is op alternation?@@(Q0Tree[ptr;Q2])dyadic is fn dyadic?qC(@XW((Tree[ptr;Q3]>Q0)Q0 exit if argument to monadic fn is a terminalor X0+(zz bldalt0 Tree[ptr;Q3] igin0@edw Q0 monadic fn w/non-terminal arg, recurseem@0l(dyadic:(Tree[ptr;Q2]>Q0)l1 0XW( zz bldalt0 Tree[ptr;Q2] dyadic fn, condiitionally process left arg[X0P1(l1:(Tree[ptr;Q3]>Q0)Q0 00xY( zz bldalt0 Tree[ptr;Q3] 0 1008U( Q0 conditionally process right arg8XPX(alt:(Tree[ptr;Q2]>Q0)l2 fn is alternation, is left arg non-terminalX d(Stk(-ptr),Stk 08d( zz bldalt0 Tree[ptr;Q2] \sta0XX( StkQ1Stk stack alternation path, process left arg, pop stacks1,m)XH`x(l2:(Tree[ptr;Q3]>Q0)Q0 is right arg non-terminal?H ؊(Stkptr,Stk Q 0c( zz bldalt0 Tree[ptr;Q3] 0XY( StkQ1Stk stack alternation path, process right arg, pop stackpathXlast(VWbldtags[( 0   arra l=! ig(deX(Q p1H ix ro0 er ]  s r  1[P fexalctem8 `lalat11x> e 0iaec v v PQQ ubalar@ct h. $,VWX)YZ[LXp]@@0(p bldtags v;altflg;altmsk;cell;l;res;stp;t;tbl@0?( pattern tag building function0H(

is a p-array marking a tagged portion of textE(HPbl( is a three or four element vector of enclosed arrays:ll>PXPX( the first enclosed element is a boolean mask marking the initialX@Y( position of hits in the result of @P,Q) the second enclosed element of is the tag number+/tbPXW( the third enclosed element of v is a p-array defining the prefix)XXW( the fourth (optional) enclosed element of v is an alternationnalX(`( choice mask.(p((8x( origin 0 dependent( w(res>v[Q0] dFn @y( stpQN1+>v[Q1] pick right argument apartqC(@(x((altflgQ4v)l0 (Ptl altmsk>v[Q3] fetch alternation mask if one was providedbltP01(l0:v>v[Q2] get prefix string0@altflgl1 do we have an alternation mask??@((v[Q0]v[Q0] (0H( v[Q1]<(t/altmsk)/>v[Q1] 0`tag resres^altmsk disable hits which don't correspond to correct choicetribut` `(l1:l>v[Q0] h~( v(tblres/res)+(res/l)\(l/res)/>v[Q1] compute offset of each tagged stringack dFnhXHW((l>p[Q1])l2 does p-array have non-scalar length attribute?arg[X(tbltbl,v,[QP5] l termi(8v( l3 no, build table w/scalar length8`t  l2:tbltbl,v,[QP5](l,Q0)[((>p[Q0])/res)v] yes, index correct lengthste off`(excl3:v+/tbl[; 0 1] l3:v(Pbl tbl((v)=vv)tbl select hits with unique last charsres)vPH}(cell>Tags[stp] fetch array holding data for this tagHp tbl((tbl[;Q0]cell[;Q0])(+/tbl[; 1 2])+/cell[; 1 2])tbl ignore new entries w/same offset pPleTags[stp] - an n2 integer matrix with one row for each node which isX` either tagged or which corresponds to a non-deterministic op.tribut`P Tg the first column contains the node (step) number. PXPX( the second column contains an origin 0 index into and(X(( .(?(XX( - a vector of enclosed integer vectors each representing aix)X0( prefix vector.0`((b indices into are represented as positive integers or 0.w/same `XHW( step numbers are represented as absolute values of negativeX(( integers.3:v(XV( - the critical step number at which the corresponding prefixr XXV( string can be evaluated (i.e. the last step number in the XXY( prefix sequence). this is 0 if the prefix is composedX@y( entirely of references to . ig@ frhis taXx( - a two column integer matrix. the first column containsingQXX step numbers, the second column an origin 0 index into X@Y( which yields the suffix p-array.?@fecarray Pbl( - alternation path table, an nm integer matrix.cell>PX,[P the first column contains tagged step numbers which are+/tbXXibt descendants of one or more alternation nodes. the remainingX` of columns form zero-padded vectors which represent encoded path-scalar`Xo o information for reaching the tagged node. each vector isv[QXXtha comprised of a list of node numbers which are alternationngtXXofs nodes. if the sign of a node number is negative then thenonXX cr tagged node belongs to the left subtree of the alternationQ1XX0)Q node. if the sign of a node number is positive, the tagged;XXtkQ node belongs to the right subtree of the alternation node.TrXck ' ocs =t ac ioQ1tXZ(Prt(((Semst[;Q4])opSemst[;Q1] 7 8 9 10 11)/Q1Semst),[1.1] Q0 list of nodes which are tagged or whose op is one of '*+~-' (Sut 0 2 Q0 n ar, opop[Prt[;Q1]] initialize suffix table, generate boolean selecting those rows of Prt which correspond to '*+-' Stk 0(limQ1Prt (( cntQ0 \ 6( PrvQQ z) 8U( PrcQ0 setup for loop thru nodesn8@0(l0:(lim@Q3])` (t cat  !b=!D( PD(`D(  h  D( (D(XxD(XD(PD(  8D( x8. t& Uabcde_,fgd 88p(zli cat ri;cflg;lb;rb;t;u;v;zb;zidFnma808( p-array catenation functionQ10X( the result is the p-array formed by catenating p-array

  • ode?QX(0( to p-array .cat(@( ( algorithm:Fn X ( the boolean part of the result is first computed by locating allerXPay[ hits in the left argument which prefix any hit in the rightPX`5( argument. the integer part (length) is then computed by adding, pX`( together the length attributes of each of these adjoining hit pairs.es ] `!(Piz arrays with their 0-closure bit set present a special case.PX5( if either array is a 0-closure array, then all hits in the otherTrXX( argument appear in the result. the 0-closure bit is set in theed;XHh&( result only if it was set in both arguments.nE(Hh((8( origin 1 dependent(P] cflg,Q1>li[Q2],ri[Q2] put 0-closure bits in a vector(/trP 01(lb>li[Q0]  8( li>li[Q1] disassemble left argsn8 `(rb>ri[Q0] ` 8v( ri>ri[Q1] disassemble right argyner8Preuzblb\v(tli+lb/lb)urb/rb boolean part of resultpart oPP> 2zi((lb/zb)/li)+(,ri)[(Q0ri)uv/t] integer part of resultPH(cflg[Q0]l0 is the left array a 0-closure array?E(H(x((/trb>zb)l0 (8U( zi(zi,(rb/t)/ri)[(zb/zb),t/t] 8@0( zbzbt merge widowed hits from right arrayc@HY(l0:cflg[Q1]l1 is the right array a 0-closure array?H(((/tlb>zb)l1 lsr] (8 zi(zi,(lb/t)/li)[(zb/zb),t/t] 8@Y( zbzbt merge widowed hits from left array>@xl1:z((ALF)ind)Q0 validate extremums of ranges'''Pinp(((Q1msk,Q0)QN1Q0,msk)Q1+msk\len)/inp insert appropriate number of fields to accommodate expanded ranges StkP Qjj-Q1,Q1-+\QN1len-Q2 compute starting points of insertsse:iP H (lenlen+Q1  X ( iota(+/len)-len/+\QN1Q0,len displacement indices for each rangeTrX`inp[iota+len/j]ALF[iota+len/ind[;Q1]] finally insert the actual charactersut`Pas norng:(Q1<+/mskinpYnot)Q0 must have at most one tildet''P w(iinpTRMC h h~( inp[i/i]MC[TRMCi/inp] any extraneous meta-chars in ccl are treated as literalsFnh(((/Q1msk)iecaset(((tmsk[Q0]QN1inp cat(HX ( z(~msk[Q0])'~',Tname,'''',((Q1+t'''')/t),'''' E(HHY( Q0 generate code for inclusion or exclusion classE(H((iecase:indmskQ1 fg( ( iindinp F 0( t(~i(ind+Q1)QN1inp)/i08p(zTname,'''',((Q1+t'''')/t),'''' yner8H}( Q0 inclusion with exclusion class is more complexE(H1 23 ((x&Xchkact ( 8en  ask =!] 1 (qbp0 bv@an`[2lbac0(` \t u) q(  0: (( ETh 'etco(nmxceed((lXv) cisquot0p ( &X:ld0(0(chkact;i;j;k;msk;pat(0@Z( validate action template.@A(0X`5( sets global masks and for use by action template processor;X8U( may set and as well.k dFnas8X5(QmTmQ0 scalar values mean no quadnames, no tags, respectivelyngeTrX@`((Q2Cvp)Q0 exit if no action templateomple@  Z(pat>Cvp[Q2] n X ( (/k(Ydel,Ylsub,Yrsub)pat)Q0 exit if no dynamic meta-charssult.X(8((/mskpatYdel)lerr (P ' mskmsk\msk mark executable segments of the template:CurptP0(mskmsk^(pat)QN1patZquad to0@0( (Qnmsk/msk)l0 branch if no quadnamesh @hp~(Qn+/\pat[Qn.+ 1 2]^.= 2 3 'cclpnn' look for , , and ( = 1, 2, 3)nh @(mskmsk\QnQ0 X( (QnQN1+(QnQ0)/Qn)l0 check if we've got any valid matches now, pX?(Qmmsk +i Qm[Q2+Qm/Qm]Cfflg[Q5]Q1 save mask marking extremums of quadname matches, and note requirement for generation(+\@8(l0:(/Q1k)Q0 exit if no tags to process>@ Z(ipatYlsub o P(Q1 k+\i-jpatYrsub compute nesting levels of pattern tagsmskP08((/msk<\~k 0 1)lerr 0 ( Tmmskij Pten (QN1k)lerr nested or odd-parity tags must be rejected TmP l(mski@HX ( determine maximum closure length for array na;j;leHF(X5( employs alternative algorithms based on the detection of specialw, pX+( cases(0( origin 0 dependent( P(~ wsfflg@dFn k  QN1+Pski --- initialization and some special case detection ---jected Pk\ 0 1)HY(wsfflgQ0 this flag is set if we encounter a ws full(HX`5(l0:zar this is also restart point after wsfull aborts special casesXHH((/l>ar[Q1])Q0 exit if length attribute emptyxE(Hp((wsfflg<(Q1l)^.=l)l1 use special case if all lengths are same and ws full flag not setp lrCurptr@( --- general case, iterative algorithm ---sh @gnlindex 8Z( on entry: is argument p-arrayn8Peya contains length attributes (i.e. >ar[1])r' sigP[;3Q0)Q0P T on exit: contains length of each hit after closure takenPreeed [15od-rity tPer zl initialize result of algorithm to existing length vector P@8(indind/ind>ar[Q0] compute hit indicesmple@e hl(ind,[QP5] l)Q0 create table with hit indices in first column and corresponding lengths in second column; add extra row containing zeroesde taXh(msk(ind)Q1 this marks hits that have not yet been exhaustedngeTrXPorblp:indind+msktl[(QN1l[;Q0])ind;Q1] look for linked hitsbPP  zz+l[(QN1l[;Q0])ind;Q1] adjust max. closure lengthsecursivPP[1](/mskmsk^tQ0)l5,lp repeat if any unexhausted hits remainPar eated X( --- fast special case for p-arrays with uniform length attribute ---Xneumeta-cpl1:trap'1 c trap',wsfull set ws full trap to cause switch to more general algorithmqC(p@Y(ind>ar[Q0] extract mask from argumentarrayc@0c((Q1=lQQl)l2 is length 1?Q0H~(t(ind)l we'll need this value several timesvalidHHh&(zl+/^\ind/((lt).ind)^(lt)(t,ind)ind esH8p( l5 compute maximum closure lengthss8[TMi/inp]X( --- special case for p-arrays with uniform length atttribute of 1 ---XinMC i @L(l2:indind @y((Q4ar)l3 right scope mask present?tqC(@((pvind/ind>Q0,QN1ind ( ( t(pv)Q1 q ( l4 no+\ @ (l3:msk>ar[Q3] yes, use right scope mask?@((pvind>Q0,QN1ind t((P ( tpvzQ0,QN1msk g ( ms zt/z (( tind/\t\zQN1Q0,z )(H( pvind/pv generate right-bounded partition maskE(H(8(l4:zpv ppls t rs.3:v(Yo l5 HP( --- ws full trapped, revert to slower algorithm ---?H16 rng:((8v(wsfull:wsfflgQ1 ((`( indlmskpvtQQ (X( l0 set ws full flag, clean up, and branch to general case algorithmX tectual XX( --- final processing: set 'kleene closure flag' in 3rd cell of ---Q1XX( result p-array if appropriate. we can then remove all 0-lengthonX8U( hits from the first two cells.8d[Q] fi0(l5:trapQQ clear trapx error08v(tzQ0 mark hits with non-zero length8H}(z((>ar[Q0])\t)(t/z)(~typ),Q0 build results:E(Hr ro(delfsyd ( ' ',p1p=!9ps k@ p31ior[')X F712@;l`] e teas03]pgus r Hrex  e  a  t  en ayP heh lo t  r 0 e. H of x in at ( is h p lu ts  o (fs @lo th re wa et ] `f s p( (rsyical(0(99 delfs er;lx;trap;delsig0x copyright 1981 1982 1983 1985 ipsa: lhg,mde-12jul81 25feb85 *del* apl full screen del editorx0e(trap' 0 c signal 4er' 00X( (0=nc '99')/'99''''' 00hW( del(99,' ')[io],01er siv0HP( (del(names^.=' 505 pcworksdelf')/nums)3 E(H@y( '505 pcworksdelf' stie del((50)0,nums)0e@X(99('Tn' pack del) pins('Rc' pack 0) pins('Buf' pack 99) pins('Name' pack er) pins 'Qio' pack io ((8v( pdef read del,6 (!( er''(8(trap' 0 c ',6 ( ( lx'',7 Fn 0c( (0=10'Name' pval 99)5 n00c( 9999 pins 'Typ' pack,4 0X( 9999 pins('Typ' pack,2) pins 'Rnp' pack read 'Name' pval 99 XpV( 6@Y(9999 pins 'Typ' pack nc 'Name' pval 99 @ 9999 pins 'Rnp' pack1((3='Typ' pval 99)/'''1 fd'''),' ',((4='Typ' pval 99)av),'Name' pval 99n V(del @8( ('Rc' pval 99)4,0,9,11,12,15,14,16,17,8qC(@0Pc(9999 pins 'Rc' pack 9 rror0V( 6 (('Arg' pval 99((P ('Arg' pval 99 s.3:v((( ('Mfl' pnc 99)10 )(V( er0(9999 pins 'Rc' pack 1 1?Q0W( 6 i0e(er,5 ws 'Arg' pval 99 0X( (er((1=1er)2=er[(er0)1])/'incorrect data type')6 ---Q1X@( 9999 pins 'Val' pack'Arg' pval 99 ayc@W( 10np]0d(er,5 ws 'Arg' pval 99 msk0pR( (0 19 =er 0 19 1[(1 0 =(1=1er)^ 0 2 =er[(er0)1])1]'incorrect data type')/13,6 qC(p@`( (er('Mfl' pval 99)/'not without rep')6@@0(('Arg' pval 99),'''Val'' pval 99' --sh @0W( 10a-c0(er3 fd 'Rnp' pval 99 Tm00( (er(0=10er)/er)17,60H(('Rnp' pval 99) replace 1fi 'Name' pval 99 s:E(H( 17ed @ (('Name' pval 99),'''Rnp'' pval 99'flg>@((('Tns' pval 99)19 (08( (1<'Ord' pval 99)18 t''00( 9999 pins 'Rc' pack 5 :i0( 6ty t@(names[numser;] erase er'Tns' pval 99ig@(0(untie 'Tn' pval 99 ( ( 996 12 1 0 1 (error 99 (hnsHHck,4 (=! inacamh99 in8acPe'p pi pa  (U ((zerror;iodFn 0 s( error message printer.pac0XX( on entry, is the origin-1 cursor position into the relevant1XX( template followed by an optional 1 if the action template was beingX c( processed. X( the result is a character vector error message, with caret.rithmX!(ioQ0 X(zQ5er[Q0;]  @( z'pattern ',(~^\zQBQ)/z error message@(@P_(zz,CR,' ',(,>Pat[Q1Curptr]),CR,(-Q3+(+\((Q1Q1Curptr)>Pat[Q0])>Cvp[Q0])Q1Curptr)'^' recreate faulted line with caretp;FBd 'Rh(@ Uessential3:v(` [@@:ind(=!t1)(i amQ1),  wpio mx  FX 14 hkms] (@ (U|i}h(0H(zessential tree;ind;stklter0` return indices of those rows of which must contain a 1 for thereer(`( ( to be any match(!((P ( origin 1 dependentpva(@(zQ0 h~( (stkQ1tree)Q0 initialize result and prime the pump (exit if tree is empty)k dFnh@@P(lp:(stk)Q0 we're done if stack is empty@ x(indQQstk dFn (( stkQ1stk pop stack(`rr(tree[ind;Q1] 7 8 10 11)lp abandon this path if op is , *, ~, or -[15] m`hzz,(Q0tree[ind; 2 3])/tree[ind; 2 3] @(@@ ( lp references to other rows are stackedetec@oces` HWex1( #((/{a?*b}( ex2( ( /{a?*b}/leaf((genaltZftr (941@-=!1@11 ] H2 1/00 9p 8  5  9@3\X95^96inH qpngh  < '  (5)4^ 8  0  P 8 !9 "67 #( #/#3 8$9x% %8(&^1`'] (1( @@8 (. U$Z(X 6@8pZ(zgenalt parms;aflg;la;p;pre;ra;stpFnh8@( macro for generating an Alternation function[@(8v( parameters are:((8( [1] : step number(H( [2] : successor function number (0 if terminal)E(H0h( [3] : left argument string fa00H( [4] : right argument stringal0@@P( [5] : pattern tag number (0 if no tag)edetec@@k( [6] : prefix variable number (0 if no prefix)@X( [7] : prefix variable numbers which this step is responsible foreingX( ( generating.l((( [8] : suffix codelk<((( [9] : reservedyical(((( origin 1 dependent(HX(stpQ1p,>parms[1 2 5 6 8] pick parameters apartE(H X(pre'P',p[Q4] `z'zf',stp,';t;u',((p[Q2])/';'),(~p[Q1]Globnl)/';F',stp generate header(`(X(zz,CR,'uLen1'8e le(`(;aflgp[Q1] 0 1 Alt set flag if we have any tagged nodes as descendants(z[0`@ ((p[Q2])l0 is there a successor function?@(!(zz,CR,'zF',stp,'',(>parms[Q3]),' merge ',(>parms[Q4]),aflg/'A',stp,'',pre,' shftl>',(>parms[Q4]) indexp Q0 0( chktag no, code is simple0X(l0: yes, we must provide code for evaluating both alternativesevant1Xzz,CR,'F',stp,'',(la>parms[Q3]),' merge ',ra>parms[Q4] merge arguments (with left arg dominant) to produce result@0(aflgl1 do we have any tagged descendants?ig@x(zz,CR,'u>',pre,'[0]A',stp,'(u)0 tu/uA',stp,'[(>',(ra indexp Q0),')[t+>',pre,'[1]]/t]1' generate code for building an alternation choice vector3h~(l1:zz,CR,'(>',(la indexp Q0),')^>',ra indexp Q0 mask marking bits set in both argshzz,CR,'\(((>',(la indexp Q0),')/)/>',(la indexp Q1),')((>',(ra indexp Q0),')/)/>',ra indexp Q1 mask marking those hits common to both args which have`;1zz,genprefix>parms[7] generate any prefix variables we're responsible for,i1`@`(zz,CR,'zf',p[Q2] invoke successor function@ tizz,CR,'((z[0]',pre,'[0])/)exit' compare successor fn result w/prefix array, exit if all hits were maintained or if there are no alternate lengths,CR,'zz,CR,'t>',pre,'[0] ut>>z[0] ^((t/u)/>',pre,'[1]) shftr u' difference vector shifted to correspond fn resulton(+\pR(zz,CR,'F',stp,'[0 1] ((>',(ra indexp Q0),')/)/>',ra indexp Q1 assign new stack varqC(p czz,aflg/<'u>',pre,'[0]A',stp,'(u)0tu/uA',stp,'[[t+>',pre,'[1]]/t]1' code to build alternation choice vectorAlt[;Xh(zz,CR,'zz merge f',(p[Q2]),'exit' call successor function 1 ---X(chktag:p[Q3]l2 s)=vv((  zz,CR,'exit:' ',(p[Q(@( Q0 should we generate pattern tag code?sh @`,'(l2:(p[Q1]Alt[;Q1])l3 is this node the ancestor of an alternation node?oice`P//zz,CR,'exit:F',stp,' bldtags (z[0]),(<',(p[Q3]),'),<',pre preP8p( Q0 pattern tag building code<(Fn c8`nc l3:zz,CR,'t1Alt[Alt[;1]stpno;] t(t0)/t' get list of ancestors,(ra i`hzz,CR,'u''(A,li3,=,i1,)^'' fmt(t;t0) u1,u' get alternation maskk dFnhpzz,CR,'exit:F',stp,' bldtags (z[0]),(<',(p[Q3]),'),(<',pre,'),parms[1 2 5 6] disclose numeric scalar parametersPHe(z'zf',stp,((p[Q1]Globnl)parms[Q3]),' cat ',>parms[Q4] p-array catenation code99n `(zz,genprefix>parms[7] generate any prefix variables we're responsible forice` (p[Q2]l0 @ x zz,CR,'zf',p[Q2] generate code to invoke successor function fn, unless this is terminal stepxH(l0:p[Q4]Q0 pattern tag associated w/this step?tE(H d(uQQ `x( (aflgp[Q1]Alt[;Q1])l1 is this node the ancestor of an alternation node?1`0 (tQ1Alt[Alt[;Q1]p[Q1];] tag 08U( t(tQ0)/t get list of ancestors c8p(uQN1,'(A,li3,=,i1,)^' fmt(t;tQ0) mvs generate alternation mask expressioncodepP_(l1:zz,CR,((p[Q2])/'F',stp),((~p[Q2])/'z'),' bldtags z[0],(<',(p[Q3]),'),(.P$9%] @&9't (.'()96*  p@@P (, U "$Zr_d| ?@@0(zgencls parms;a;aflg;b;p;pre;stp;t;typ;u] uQ@Pt[l macro for generating a positive or kleene CLoSure functionQNP(( parameters are:((( [1] : step number(H( [2] : successor function number (0 if terminal)E(H0( [3] : left argument string an00( [4] : right argument strings 0@`( [5] : pattern tag number (0 if no tag)refix)@@( [6] : prefix variable number (0 if no prefix)@X( [7] : prefix variable number(s) which this step is responsible for<(X(X( generating.e le((( [8] : suffix code=vv((( [9] : reservedg.p[Q(@ ( [10]: closure type 0=kleene, 1=positiveon;u @((8( origin 1 dependent(8Z(stpQ1p,>parms[1 2 5 6 8 10] k dFn c808( typp[Q6] pick parms apart08U(pre'P',p[Q4] prefix variable names8xz'zf',stp,';msk;stk;t;u;x;y',((p[Q2]Globnl)parms[Q4]),(p[Q5])/',rel[',(p[Q5]),';0]' no, we can generate simple code99n 0(p[Q3]Q0 pattern tags?ttern 0z(uQQ `8 ( (aflgp[Q1]Alt[;Q1])l0 is this node the ancestor of an alternation node?0`0(tQ1Alt[Alt[;Q1]p[Q1];] ters08p( t(tQ0)/t get list of ancestorsh8p(uQN1,'(A,li3,=,i1,)^' fmt(t;tQ0) mvs generate alternation mask expressioncodepX(l0:zz,CR,'z bldtags (z[0]),(<',(p[Q3]),'),(<',pre,')',aflg/',<',u hmX8( Q0 pattern tag building code<(8H(l1: yes, we must include machinery for backtrackingE(Hx(zz,CR,'F',stp,'',typ,' closure ',(>parms[Q4]),((p[Q5])/',rel[',(p[Q5]),';0]'),' zstk(<(>',((>parms[Q4]) indexp Q0),')0),(0)0 0' compute maximum closure length, initialize empty result`zz,genprefix>parms[7] generate any prefix variables we're responsible for(`He(zz,CR,'t((>',pre,'[1]) shftr >',pre,'[0])^msk>F',stp,'[0]' shift prefix array and ^ with closure to get likely matcheslt[;`QQzz,CR,'F',stp,'[1]<(msk/t)/>F',stp,'[1]F',stp,'[0]t[0])^y>',pre,'[0]',(p[Q3])/')l1' examine result of sucessor function, extract hits, if this step is tagged, then include test and branch codemskV(aQQ `n,u (aflgp[Q1]Alt[;Q1])l2 is this node the ancestor of an alternation node?t`0H(bQ1Alt[Alt[;Q1]p[Q1];] 08U( b(bQ0)/b get list of ancestors8paQN1,'(A,li3,=,i1,)^' fmt(b;bQ0) mvs generate alternation mask expressionqC(pl2:zz,(p[Q3])/CR,'F',stp,' bldtags ( marks positions where a hit was extinguishedE(Hzz,CR,'(/msk(>F',stp,'[0])^(((>',pre,'[0])/msk)/>',pre,'[1]) shftr msk)0' shift mask right to align it with F varon(+\hp~(zz,CR,'(/>F',stp,'[1])0' exit if we've already shortened every hit to zero lengthh*(zz,CR,'F',stp,'(',(>parms[Q4]),((p[Q5])/',rel[',(p[Q5]),';0]'),') shorten F',stp,' l0' generate new hit mask, shorten lengths, go back if any hits remainvn+(8tersgencode(arxx [3]xG =!n xve8e ` nag5]X ppacis ed er 6] w s  o y fon) @ xt ta di  e 8h x it xt 0rc 2n co @ nt di @ng  tXng[1 par loH!te" w#12$ i8%er`&nd'um(s.) H*ar+ng,ed->t0.heX/] 0atp1fo2g[02 p3it3um4ve 4e `5nd5e 6 6tcH7d 7t.89]80 @[2xppa mZ []^_,(@ 8Pt [24]pPcoeflg gencode tbl;io;cnt;lim;name;negflg;parms;t;u;v;Globnling bP(( pmatch code generator(X( compiles the top level function as well as a series of,u hmXXo( subfunctions , , ..., f. one subfunction is compiled for(XH( each non-terminal node of the pattern's syntax tree.(H(z( =V(ioQ1P[2]negflg10tbl[;Q1] set negation flag if ~ opcode appears],(<'P0(Globnl,>(/Q0,,>Prv)١>Prv 20h~( Globnl((Globnl>Q0)^(Globnl)=GlobnlGlobnl)/Globnl globally referenced stack varsnh ((t, 0 1 Alt h t((tQ0)^(t)=tt)/t get nub of list of nodes which create alternation varsack dFnh(t'zpfind;io;trap;i;j;k;msk;rel;Dimsk;Idmsk;Len;Lnmsk;Nnmsk;Qcmsk;Qrmsk;Semsk;Semst;Tag;Tags;Txmsk;t',(negflg/';Negmsk'),(,'<;P>,li2' fmtPrc),,'<;A>,li2' fmt t generate header (augmented by )Codet,CR,'io0 trap'' 999 c l2'' ',Tname,'1/',Tname,' Tags',(+/Semst[;Q4]),' dependent) prefix varson maskPPQ1ACodeCode,CR,'pdef ''pfind'' pex PFNS' define local fns23] P8p(l0:(u)l2 loop through prefix vars8V(tQQu  ( uQ1u @ 8U( (v>Prv[t])l1 is prefix empty?8PpQCodeCode,CR,'P',(t),'',5,'rel[,i4,;] cat ' fmt v n noP@ ( l0 no, generate prefix expression and go on@@(l1:CodeCode,CR,'P',(t),'(rel[0;0] z(rel[0;0])/z)/>rel[0;1]),rel[0;2]' [21] uhH( l4 no, result is obtained directly from edE(HPp[2l3:CodeCode,CR,'zf1' yes, call first compiled functionsor fPx`(CodeCode,negflg/CR,'t>z[0] iNegmsk^t z[1]<(t/i)/>z[1] z[0]z[2])[0]l0 z((>z[0])/Len),[0.1]>z[1] l1' check for <> flagxX(CodeCode,CR,'l0:z(Len),[0.1](>z[0])\>z[1]' construct resulte coX`x(CodeCode,CR,'l1:',(~flg[10])/'i+/z z((i)=ii)z' check for <> flag(``CodeCode,(t/Q0tbl[;Q4])/CR,'setuptag z[;0]' pattern tag code required??0`hraiCodeCode,CR,((Q2Cvp[2]'),'exit' action template code required?hpl5:CodeCode,CR,'l2:z5er[0;]',CR,'exit:z,(parms[1 2 5 6 8] pick parms apart@8U(pre'P',p[Q4] prefix variable name 8xz'zf',stp,';flg;msk;t;u;x;y',((p[Q1]Globnl)parms[Q4]),' z[2]<1 0>z[2]' no, we can generate simple code0`0j(p[Q3]Q0 pattern tags?0V(uQQ `@( (aflgp[Q1]Alt[;Q1])l0 is this node the ancestor of an alternation node?(`0j(tQ1Alt[Alt[;Q1]p[Q1];] n no08v( t(tQ0)/t get list of ancestorsn8p(uQN1,'(A,li3,=,i1,)^' fmt(t;tQ0) mvs generate alternation mask expressionultpP21 l0:zz,CR,'z bldtags z[0],',(p[Q3]),',(<',pre,')',aflg/',<',u P8pZ( Q0 pattern tag building codeionn8H(l1: yes, we must include machinery for backtrackingE(H(zz,CR,'F',stp,'',((>parms[Q4]) indexp 0 1),',<1 0>',((>parms[Q4]) indexp Q2),' z((>',((>parms[Q4]) indexp Q0),')0)(0)0 0 flg1' assign temp, result[26]`zz,genprefix>parms[7] generate any prefix variables we're responsible for [`P tizz,CR,'l0:tf',p[Q2] invoke successor function functiond w/P0(p[Q3]l3 pattern tags?sor f0p(zz,CR,'(/u(x>t[0])^y>',pre,'[0])l1' examine result of successor function, extract hitsp(uQQ `or[ (aflgp[Q1]Alt[;Q1])l2 is this node the ancestor of an alternation node?o`0P(tQ1Alt[Alt[;Q1]p[Q1];] 08Z( t(tQ0)/t get list of ancestors c8puQN1,'(A,li3,=,i1,)^' fmt(t;tQ0) mvs generate alternation mask expression [24]pXo(l2:zz,CR,'F',stp,' bldtags (u',(p[Q3]),'),(<',pre,')',aflg/',<',u 1X8U( l4 pattern tag building codeemes8p0] l3:zz,CR,'u(x>t[0])^y>',pre,'[0]' examine result of successor function, extract hits.[(epP []l4:zz,CR,((p[Q3])/'l1:'),'zz merge t ' update result99)1PPs 2zz,CR,'(flg^/mskx marks positions where a hit was extinguishedE(H(zz,CR,'(/msk(>F',stp,'[0])^(((>',pre,'[0])/msk)/>',pre,'[1]) shftr msk)0' shift mask right to align it with F varon(+\^(zz,CR,'flg0 F',stp,'[0 1]((msk)0)0 tmsk0 l0' turn off matches for extinguished hits and try againts (UgennegZ( h;s H H',(((=!';ener l H pl1e r [2X ,' cl pa p@ l[h,' wraco0p[at [ 1]pls Xncn @n  lt0X (U$Z99)100X(zgenneg parms;p;pre;stp;vnamk 0@8( macro for generating a NEGation functionvnamd@(( parameters are:((( [1] : step numberor(H( [2] : successor function number (0 if terminal)uE(H0k( [3] : left argument stringu 00e( [4] : right argument string0@Y( [5] : pattern tag number (0 if no tag)ion? @@y( [6] : prefix variable number (0 if no prefix)@XX( [7] : prefix variable number(s) which this step is responsible for1X(( generating.((X( [8] : suffix codep[Q((( [9] : reservedg.=vv(V((( origin 1 dependent le(@(f(stpQ1p,>parms[1 2 5 6 8] pick parms apart@H (pre'P',p[Q4] name of variable holding prefix array(Hh(z'zf',stp,';t;u',((p[Q2]Globnl)',((>parms[Q4]) indexp Q1),')l0' does argument have a scalar length attribute?xXo(zz,CR,vnam,'(Len0)(0)1 0l1' result is an unbounded arrayregX(zz,CR,'l0:',vnam,'(',pre,'[0])/Len uLen0 u[(>',((>parms[Q4]) indexp Q0),')[t+>',pre,'[1]]/t]1 NegmskNegmsk>u' clear hits in global negation mask,CR,'8pZ(p[Q2]Q0 is there a successor fn?ns8`8 (zz,genprefix>parms[7] generate any prefix variables we're responsible for [`@8(zz,CR,'zf',p[Q2] invoke successor function@h~(zz,(p[Q3])/CR,'F',stp,' bldtags z[0],',(p[Q3]),'',pre pattern tag building codeFnhhits h( suffgenprefixp[Q(F7 s=!nge CL tiXpapre1]mb[2esso he (U, X(zgenprefix vn X( generate a line of code which builds the prefix variables enumeratedX8v( in integer vector argument k dFns8V((X( origin independent le( d(zQQ H( (v)Q0 exit w/empty result if prefix pointer is 0(Hx`(zCR,QN1,(0 5 ('p

    q<>li5' fmt v),'mpn< cat >q<;] cat >bi20' fmt>(-/Q0,,>Prv[v])١>Prv[v]),'' let fmt do the workltble (]genrellva(t)ub o`(=!cr`na[1fihap;rdm`skxsksk ;T( t' ;N '< fm8 <;X mt atau < [t, `99 1/X +/`8pZ ($ ]i^l488v(genrel;io;cnt;ess;ind;lim;msk;tk dFns8@8( generate code to build the tableGation @X( the rel code fragment table is an n2 array of enclosed characteredXPCoe vectors. the first column contains code for generating thecnPXo( boolean part of each entry, and the second column containsr1XP,' code for generating the integer part of each entry.rd cP(V(ioQ1@0 (ind,',(e coX`x(Relcf(tind=ind)Relcf remove all but the first occurrence of each rowe?(`8}(Idst/Ids extract unique identifiers8Pisaind(t/ind)ind generate index map for pointer relocation(>ReP((mskQ0E(HH((cntess)l1 is a hit in this line of code critical?HX(CodeCode,CR,'t',(>Relcf[cnt;Q1]),' relrel',>Relcf[cnt;Q2] d for(X@(f( lp no, generate straightforward code@`l1:CodeCode,CR,'(/t',(>Relcf[cnt;Q1]),')exit relrel',>Relcf[cnt;Q2] 0`Xh( lp yes, generate code which provides for a possible early exit hmXtep (9$gentagfixvv( 0.l1'`(=![2`od(](1]@uc28de(~0 ip   < 9]@e,Xl[se0]n peq] 0,CHp)ac),acatequi`0 (U$Z_@v]),00 (zgentag parms;aflg;p;stp;t;u n08}( generate code for a tag functiondFn8 ( parameters:n (( [1] : step number(H( [2] : successor function number (0 if terminal)E(H0( [3] : left argument string00( [4] : right argument stringo0H( [5] : pattern tag number (had better be non-zero)al?H@ !( [6] : prefix variable number (0 if no prefix)@X( [7] : prefix variable numbers which this step is responsible forel coX(( generating.((( [8] : suffix code3] (( ( [9] : reservedl(((X( origin 1 dependent(cn(@0 (stpQ1p,>parms[1 2 5 6 8] pick parms apart@Patoz'zf',stp,((p[Q1]Globnl)parms[Q4] pass argument as result2] 0``zz,genprefix>parms[7] generate any prefix variables we're responsible for?(`` lszz,(p[Q2])/CR,'zf',p[Q2] call successor function (if there is one...) gen`(uQQ `hi (aflgp[Q1]Alt[;Q1])l0 is this node the ancestor of an alternation node?t`0 (tQ1Alt[Alt[;Q1]p[Q1];] 08Z( t(tQ0)/t get list of ancestors8p(uQN1,'(A,li3,=,i1,)^' fmt(t;tQ0) mvs generate alternation mask expressione to pX(l0:zz,CR,'F',stp,' bldtags (z[0]),(<',(p[Q3]),'),( is code fragment containing expression to be indexedR,'FP 0( is index ( ( origin independent(P nd(']'QN1cf)l0 is expression already an indexed one?[;Q1]pP((zcf,'[',(i),']' t(cn(@ !( Q0 no, simply add index brackets w/indexg c@`8 (l0:z(QN1cf),(i),']' yes, insert index into preexisting index brackets gen`t;t(/U)mergeD(ef [7] ]=!behirefo@ in[8 c0 [ve(/ (U)deD(( (zl merge r;lb;rb;(0 =( merge two p-arrays together[00( the left array is dominant.ne0X( if the two arrays both have a hit in the same position, then thel coX@( length attribute of the left array is used.@(8( origin dependentt(cn(0B(z<(lb>l[Q0])rb>r[Q0] 0Ptos lbl[Q1]),(rb/)/>r[Q1])[(lb/lb),/](>l[Q2])>r[Q2] assemble resulth;tQ(2"tnegshort(`ob@@l>Q08(=!obh8 reta0]H tt n o ic@ ltx ar 'z ; ;m( sk ;L ;Q ;SX ;Tx ms lg),80p= ( U$"t_D iNe00(znegshort p;b;pv;suf;t;u;ptio0@B( shorten the length of a negated p-arrayu;@"@8v( p is a vector of enclosed arraysdFn88U( [0 1 2] : p-array to be shortenedn8@( [3] : line-delimiting partition vector@8Z( [4] : boolean suffix vectorsn8(!(( origin 0 dependent(cn( (b>p[Q0] @dFn ( pv>p[Q3]  8pZ( suf>p[Q4] pick argument apart=(Fns8 hB((b)Q0  ` [(b/b)+>p[Q1]]Q1 generate mask w/bit set at last char of each hit2] 0` d(upv ( tu/  sufsuf>\u\tQN1Q0,t extinguish suffix hits after and including the current ones (suf>pv porscan )*@(((/(u(Q1pv)sufsuf ( A( tu/suf co h0j( t\u\tQN1Q0,t set all bits in x, up to last hit on line ((1pv) porscan suf)nh =((Q1pv)/+\t h( (pv/b)/-Q1+QN1Q0, compute shortened lengths by performing partitioned +/ack dFnht>Q0 H*( z(<(pv\pv/b)\t),([0 (=!-ae (s `[33]bo ixx  ar shp ]  or enP  0  > xfi pen0[8` lt] >p@ `inve t ] Ql)P, h: \Xdpntax ePH(parse Ipt;nextstate;token;Gpn;Id;Ipt;Len;Stack;StateE(H8U( lalr(1) table driver parser routine.s8Pnvl input token stream is contained in the right argument .yP!( =X(CfflgQ6CurptrStateLenGpnQ0 initialize pointers and counterstecoXX(Semst 0 6 Stack 0 3 IdsQ0 initialize code and state stacks hmXH*(start:(Ipt)gettoken check for empty input queueE(H(2(tokenQQSYMBS (0( cktab input queue is empty20Xo(gettoken:scansynerr bump cursor position and scan for next tokenr(XH@!(tokenQ1+SYMBSQQIpt valid token scanned from queue(H8v(cktab:nextstateTABLE[State;token] sn8` rs nextstatesynerrc get sparse matrix index and check for valid transitiontra`X(StateQ0nextstateQ2 determine next state or production numbere coX@B((Q2nextstate)read branch if read statet re@((synthesizesynerr (h0j( (nextstate pattern compiler'syn0Xo( compiles a set of functions to process the pattern and placeskX8U( them in the result package Fn8X( in the event of compilation error, the result is a character vectorcoX0( error message with caret.r [10(X( is a four-element nested array containing the locator andenr(XH@!( action templates, followed by their non-escape masks.H( (ioQ00 @dFn ( QN11  ( QP50.5   ( Q11 ( Q22  d( Q33  Q44 sue Q55 it)Q Q66 txtt QQ''  P( QBQ' ' -patn ( QNP50.5 pat  ( QPQQpack '' ( CRav[156] 0h((0=nc 'flg')/'flg'''''0 xS(sep1Pat ] ( t1Pat - 8Z( at>((Q0)(1+tsep)t)[2+/Patsep] 8 P=( lt(tsep)t X((>''tescmsk lt)l0 generate escape mask for locator template hmX (Patltat   ( Curptr>''t x6( Cvp1ltat 8P( er(1,er)er' syntax error' s8 A( PFNSerror n ffq 0, anXX(l0:(>''uescmsk at)l1 generate escape mask for action templateecoX hB(Patltat \ (( Curptr(>''u),1 ( ( Cvp1ltat 8}( er(1,er)er' syntax error' 8 ( PFNSerror    0t 0(l1:Pat(ltat),t[1],u[1]on the 0p(trap' 502 503 999 c PFNSerror 0' PFNS error traps for errors during parsinge to p@B(ALFav[86+64] mvs alphabet plus digitsh@@(PFNSQPQQ initialize empty package resultr@0(LaQQ length attribute vector0Xh(Relcf 0 2 eredX0(Tname(~flg'''_')/flg 0xPy( TnameTname,(Q0Tname)/'Txt' generate name of text vector (set before modifying!)9C(x@P(flg'''_'flg generate flag vectorre@rprurptr+8pZ( begin generation of code fragments.8k 1 Ipt0X(CodeQQ gotta start somewhere0H*(Cvptrmc Pat convert template to internal formaten(H@(parse>Cvp[Q1] parse the locator template;@"@8(chkact validate action template=(s c8@ !(genrel generate code which builds table@P0]Ssegen 8flg generate code for building syntactic masksw stateP8p(bldtbls generate prefix/suffix tables8@(flg gencode Semst invoke the code generatort@`h(PFNSPFNS pins pack 'Qm Qn Tm Tn Cvp Alt ','Tname' pattern tag stuff, etc ` (tCodeCR  pe( Code(tCode),(,';',pnames PFNS),tCode localize the contents of the compiled code package(ph0j(PFNSPFNS pins 'pfind' pfx Code test in development system, leave unlockedck dFnh(pevalile(020QQ (=!ag821 lib [ ( c@ntX bpws[2(~ mee)8gehe ctedX!((QN11 H( Q00 `( Q11 nx( Q22 ( Q33 t d( Q44 i( Q55  ( Q66 ( QQ''  8( QBQ' ' @dFn ( CRav[156] (x/('pfind' pdef PFNS(0P(zpfind return result0X( bldtags cat closure merge negshort ppls procact pss setuptagateecoXP I shftl shftr shorten CR Ydel Ylsub Yrsub Yrtack Zlarrow the Pdeve0 8pfx  0:bldt (=!),,'<'H p bdeH stac b( g @ CRh 'su( (((2(10 pfx 2;pfx;3(8pZ( define a function within a package.8Hx( the left argument <0> is the function's name.E(HPxpe the right argument <2> is its source, in fixable form.p[Q3]Ph( the result <1> is either a package containing just the named object, or else ak dFnh8( two-element error code from 3 fd .8(h( note: result must not be <0>, since that is likely the name of the function we dFnh(( are trying to define.( ((( 0 1 2 3(xPy((''1Q3 fd '13 2;trap;3;',0,CR,'trap'' 2 11 e 0''1pack 13 fd 2')Q0(x (13 2dFn get Utppls 0? [2X(=!xXX  (Ut, (zpv ppls vdFn (X( partitioned +\ppls((2(zpv/+\QN1Q0,v ((x/( z+\v-pv\z-QN1Q0,ze.(0(U|pretree(``eft  (=! zp;;uPshhlenera i0 o` a : ( (U|'_\((x(ztree pretree n;t;u(X(!( produce prefix string for node of syntax tree denoted by rowX( ((x/( origin 1 dependentpls(0p(zQ0 initialize empty result0XX(lp:(/u/ttree[; 2 3]-n)Q0 look for row referring to this one<X0v(nuQ1 convert to index] 0X((t[n;Q1]Q3tree[n;Q1])lp belongs to prefix string if op is catenation and current node is RIGHT son*@((0(z(tree[n;Q2]-Q0 calling ).dFnhh( for logos, result is hit matrix with first column modified to reflect final positionhh( of matches in final text. in the event of error, the result is a character vectorFnh0( error message instead. flag 0 v(; executeFn ( execute (ioflgQ0 `al0:(^/i\Hits[;Q0]QN1Q0,+/Hits)l1 check for overlapping occurrences l` @(HitsiHits (x( (flgTm)l0 ( P( TagiTag 8}( l0 remove them, one at a timedFn8 H(l1:flgl3 @( iQ0 skip pruning of if no changeesc@ (l2:j>Tags[i] 0( Tags[i]<(j[;Q0]Hits[;Q0])j 0Hh( ((Tags)>ii+Q1)l2 remove unwanted tagged hitsE(H0(l3:(limQ1Hits)cntQ0 rmat 0Plae Pat[(PatYrtack)/Pat]CR map '' meta-char to newlineits[cP8P(((Qm)+(Tm)+YdelsavePat)l4 (Fn8(( HitsHits rplc Pat pls(hx( Q0 avoid iterative overhead if action template contains no dynamic meta-charsk dFnh0(Pnmnl4:(Qm)l5 check if any quadnames in action template;] rplP(X(posHits[cnt;Q0] v((~( i(pos+Q1)Lnmsk u(Prit Qm repl((+/i)(pos)+/^\~i)[Qn] replace quadnames...} wP v(l5:(Tm)l6 Pone (PatYlsub,Yrsub) repl Tag[cnt;Tn] replace Tags if anytemplaP0 (l6:((Pat)>iPatYdel)l7 0) 0(( j((i+Q1)Pat)Ydel 3(H( tj(i+Q1)Pat pick up next execute statementnE(H((flgZlarrowQ1t eS pi(p( tflgt optional leading '' arrow indicates replacement of evaluation result in template-pvpPonr(Q0 execute t)l9 execute expression, branching on errorionPX(Pat(iPat),(flg/er),(i+j+Q2)Pat augment template as appropriate<XX((flgPat)l8,l6 check for special case of {...} with no assignment arrow -- no further work to do if so(@(l7:iHits[,cnt;] rplc Pat replace this match@(/(i(cnt+Q1)lim ileenI(h~( Hits[i;Q0]Hits[i;Q0]-Hits[cnt;Q1]-Pat adjust hit pointers for subsequent hitsalnh H(l8:Patsave  @ |( l4lim>cntcnt+Q1 loop through each match @8(l9:er[(er[i]QBQ)iQ1+erCR]'' 8` [0 Hits'pattern ',er set error message result, transmuting blank to ''ement`skT ( ]pseudocode3( se [x(=!cnx,(4]P(hnt2[]]ok3]0icp l t[ d ve taX [ v[ 1] @ fx jugipb@uffi p@ng`4])l4xH (8 U[]6^(4LH@(zpseudocode tbl;io;cnt;cr;lim;obuf;pbuf;t @P]  display pseudocode for parsed pattern represented by f,cP(1(( origin 1 dependentnI( d(ioQ1p"(zQQ Pl CR initialize empty result, define carriage returnvarSut[SutP (limQ1tbl Fn @( cntQ0 setup for loop thru rows of tableh @@(l0:(limPrv[Prt[Prt[;Q1]cnt;Q2]] rn0H0( tt+tQ0 fetch prefix vector, adjust for origin 1E(H (pbufQQ  H( obufobuf,'prefix: ' fmt prefix string prefixtsE(H (l3:(t)l4  8}( pbufpbuf,(semtok QQt),(Q1 is alternating start and end bit mask. is a vector ofzXX( enclosed character vectors, representing the replacement text.cters<XPm<n implicit argument, and result, is the action template, .P8}( assumes str +/msk^\msk .k dFns88P(psQ0 for on nested array4@(Fn8 h(b\msk @dFn @؍( Pat(mskb)/Pat remove old occurrencesen' @8pZ(len,>str lengths of insertions 8((b(msk=b)/msk^b repl(({( b(b=b\msklenQ0)/b (XX( indb/b starts of insertions (insert after these positions) rowX (lenmsk/len `e a indind++\QN1Q0,len-Q1 compensate for earlier insertions on the left table `0(msk(Q1+(Pat)++/len)Q1 er[i]0(h( msk[ind+len]Q0 ((2( msk[ind]~msk[ind] e,Y(8( msk=\QN1msk compute expansion mask8 (Patmsk\Pat A H0( Pat[(~msk)/msk]str and insert new text stringsE(Hrese0 x-rplc 1] cfR&(=!^(t`en ta Hp- gtta8Q1P t a [3 Q1H 1 p t  ri [ r:X Se mskLHexhat _ [nd0 Xate' w[3 de 8en ut fo c an p a for8U ($E&iklpFns88P(HitsHits rplc str;io;i;ind;len;msknk88}( replace function for data text.s 8Pdei each hit in the match matrix is replaced with . P`as the implicit argument, and result, is the user text vector named .ask ``Q0 for logos, the result is the hit array, with the indices modified to reflect`Pms' the final positions of the matches in the final text.1:msk(P \((h(~ ind len msk strrplc((ioQ0 Pms/ indHits[;Q0] origin-0 positions of starts of matchesiindP`ifs(^/Hits[;Q1]=lenHits[Q0;Q1])l0 check if all matches are of same length Le` v(lenHits[;Q1] ({( msk(Len+Q1)Q1 ((( msk[ind+len]Q0 ((( msk[ind]~msk[ind] (@( msk=\QN1msk compute compression mask(tbl[@0&(LenTname,'msk/',Tname '0P tx (nc 'Lnmsk')/'Lnmskmsk/Lnmsk' remove old occurrences2] P((indind-+\Q0,QN1len pl(` ms (1 0 istr)/l1,l2 adjust hit pointers, and join common insertion logicr' `h(l0:(1 0 i(str)-len)/l1,l2 branch if expand requd, or if strings conformableck dFnh (mskLenQ0  P( msk[ind]Q1  0 ( msk=\msk=(-msk)imsk genera0P ms LenTname,'msk/',Tname set up mask and perform compress P(2(indind+iind ikpi((( (nc 'Lnmsk')l2 k((X( Lnmskmsk/Lnmsk ntnI(0p-( l2 adjust hit pointers0(`\(l1:msk(Len+iind)Q0 (0<( msk[indind+iind]Q1 nd> re00[( msk=\msk=(-msk)(-i)msk >.0Pndi LenTname,'msk\',Tname set up mask and perform expand',TnP(x((nc 'Lnmsk')l2 ode (H@( Lnmskmsk\Lnmsk expand line mask as well, if definedH ((l2:lenstr X(!( Tname,'[ind.+len]((ind),len)str' insert new text into X8Z(Hits[;Q0]ind set result indicesFn80,\ <Uscan H(( (=!<(NC( <(@X<(O<((X (UDh(`(zscan8P( scan for next token in input string.8X((Q1=LenQ1+(IptTRMC)Q1)l1 fast exit if meta character encountered -- parser will determine next stateso(XZ(LenQ1Len-Q1+(Q1(Len-Q1)Ipt)Ystar,Yplus,Yminus length of char string depends on possible right closure, which has left precedence (l0:IdLenIpt  \( zQ1 8Z( Q0 set scanned identifier name 8(`\(l1:(YlbrQ1Ipt)l0 an(p( l0z(Ipt)LenQ1+IptYrbr if char class, right scope is delimited by right bracketate-pvpintoH(segen&nI(si bra9 =!odbe d:xs[2]ve(r @hive 6 ` ( Q r,0 rrHiepal d w c()/Xs'TnaIdPt en it X [ f  b ra ir  m  si el !cf h"a) # P$ge $pu%fix&ag'msx(Re8)(*\`+t)+ne(,to, m--a8.ge.S/ac /1 @0to1a @33( (&((X(segen flg;cf;flgs;i(X( generate syntactic and associated mask code fragments, based onXX|( requirements of the pattern. requirements have been maintained inH X8}( , whose boolean values are as 8 ,( follows:@dFn H(`( Cfflg[0] Semsk required (_) also: flg[0] flg[4] x eflect`` Cfflg[1] Idmsk required () flg[1] c flg[5] o >.ask `` a Cfflg[2] Nnmsk required () flg[2] q ' flg[6] s _' ins``me Cfflg[3] Qrmsk required (?) flg[3] l flg[7] n expa`8pZ( Cfflg[4] Dimsk required ()ng.88Z( Cfflg[5] Lnmsk required ()nk8`((( requirement graph --((0( Semsk Idmsk Nnmsk \nction00X( \msk0@H( Qcmsk Lnmsk Txmsk@0(( /mask 00( Qrmsk Dimsk /0XX( is also required if /flg (i.e., some syntactic interest inXX( context of matches). requirements imply proper augmentationXX( of . is additionally required if flg[0] (ie, treatmXXo( text as fn display). at run-time, the presence of '' in the variableXX( controls whether or not the text is to be treated as a functionX8( for this call to the evaluator.C(Fns8 LnTnamep(flgs\Cfflg6٢2٩\flg compute cumulative mask requirements (note -- very order dependent)pИ(cfCR,Tname,'',Tname,',(CRŢ1',Tname,')CR Txmsk(Len',Tname,')1' we always need this -- marks searchable text (flgs[Q5]end Xh( cfcf,CR,'Lnmsk',Tname,'CR' mark line-ending carriage returnseskXF(cfcf,flg[Q0]/CR,'(''''Flg)nfn LnmskLnmsk^1',Tname,'''['' Lnmsk[(1ki<\k\j10,j' mark comments in the text (iQ2~flg[1 2] x#( cfcf,(i>Q1)/CR,'mskmsk>k',(~flg[Q3])/' lex' turn off comments if we are not searching themferxsticfcf,(flg[Q3]^i>Q1)/' kLnmski^1',Tname,''''' jk/i k\k\j10,j' compute mask marking logos commentsd pxcfcf,(iQ1)/CR,'mskmskk' search comments but not quoted strings; restore quoted comment segments(xcfcf,CR,'lex:',flg[Q4]/'(/iQcmsk^',Tname,''''')blddi jiLnmskQcmsk^',Tname,''''' ij/i mskmskk<\j\i10,i' turn on quoted strings in execute stmtsH(cfcf,CR,'blddi:',(/Q1flg)/'TxmskTxmsk^msk',flg[Q5]/'>Qcmsk' set area of text to search -- either all but decorations, or else selected comments and quotesB( in pX8((flgs[Q3]i/Cfflg[3 4])end short-cut in case we don't really need diamond or query mask(p(cfcf,CR,'i',Tname,'''''',i/' DimskTxmsk^((1i),0)10,iLnmskQcmsk^i(',Tname,''' '')^(1i)1i' mark ends of statements and lines<(C( X(flgs[Q3]end `ska cfcf,CR,'QrmskTxmsk^i<',Tname,'CR' compute mask for query if required i` (flgs[Q2]end %( cfcf,CR,'iTxmsk^',Tname,'''.',ALF,''' ji10,i' mark starts and ends of searchable identifiers and constants<(X(cfcf,CR,'Nnmsk(j/',Tname,')''.0123456789'' Nnmskj\Nnmsk10,Nnmsk' detect extremums of constants only (flgs[Q1]end H( cfcf,CR,'Idmskj>Nnmsk' and of identifiers onlyE(H (flgs[Q0]end XZ( cfcf,flg[7]/CR,'ii(',Tname,''' '')^Nnmsk^1Nnmsk,0' mark searchable ids, constants, and syntactic blanks between constantsdenceh(cfcf,CR,'SemskTxmsk^i10,i' one-element spanning set for syntactic matchesack dFnhh(end:Codecf,Code insert compiled code fragment at front of global object code vectornh'inc(2g;cfsemtoki(((s)  (=!zmse;0] Horpg  f] erP p 4] (`\ (U$hT1( (zsemtok p;qFn HH<( produce source token for a Semst value pointernE(H((X( origin 1 dependent(@P((pIds[p] no, it's a reference to an id, fetch it(H`(q(~(Q1z)TRMC[MC'[?_'])'''' generate conditional quote prefix/suffix`Xo(zq,(MC2,'',av)[(TRMC,av)>z],q translate metacharacters, doneskXs th((xe [40seshowcf,CR,(8E(g\=!@E(0`D(D( `D( PD( D( 8 `  D(   8 XD( p   D(  ( H hD(    D( P x  D(  0 P D(  D(P x   D(   H D(x    D(X x   D(  `  D( @D(D(XxD(0PD(xD(8XD(D(PH (4E(HxPy(9998 seshow 97;96;95;94;93;92;91;90;89;88;87;86;85;84;83;82;81;80;seshow;ionts(x(io1 0M( (0=nc '98')/'98''''' ntro00h+( 90188' '''98 f st00X( (^/,98' ''')2 0 <( 981 ws 1Fn (98,' ',98 (( 96~98' ''' (8pZ( 981(96196,0)/96\96/98 dFns8 +( 96vi 98  @H( 96'searching ',(96),(-96=1)' functions' @(( (90/'99'),'96' (0 ( 9090/'9999,seshow,' k 'Q0(X( seshowav[157] T1(( 810 ( ( (97,97)16 h --(0*( ((197)>197)/'97,<97' 0`( 89'.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' expa` H(9698' ' (,( 91(96-1)98 ic mat( *( (91)16 ( 989698 (( (3 4 =nc 91)/6,4 l(({( (115 ws 91)4 (@P( 96'cannot process the name <',91,'>.' ep?/@  ( 90,'96' H( 38(96'<',91,'> is not a function.' nk8 [( 90,'96'  d( 3 (88[2]3 qFn 8}( 96'<',91,'> is a locked function.' 8 (( 90,'96'  3(h((801 fd 91)5 ( 8( 80' ',80 ( 92840 9/ 8318(8\((82,>97[83])15 (@H( 86(80182)^(80)(1+82)80Ţ182 k@8P( (096(86/86).+0Ӣ2+82)8 80 ( 8686\80[96]^.=1բ1820(x((/86)15,(84)14 (0+( 85(80seshow)^180'[' 0(( 85[1,6+85]871 s(8U( (9488[5 6 7 8]^.= 1 1 0 0)12 as 8(/( (/9680'''')9 l( ( 9585/\96 8( 8496\9685\9510,95 ] 8 ( 878488[6] 0((/9584<80'')11 ndind+0 X( 948595 ( 9594/95 8v( 848494\94\9510,95 <(Fns8(( (2~88[5 6])11,10 Q( ( 8787>94 1 118 (8787942] ,(88[7]12 d  ( ( 9696^196,0 tgs if(0+( (/9584<80'')12 00h( 93958584<80'' sk L0 8( 9593/95 8U( 87879594<\93\9510,95 n8(( ( (/96^95)12 3])/CR(`( 96'*** warning: nested quoted strings used with execute in <',91,'>.' ins` ( 90,'96'dFn 8p(84(\85685)<88[8]84^87 ble8(P( 9687^8089 (((( 969610,96 u( -( 8787\96 @<( (88[4] from the array -@S(#Xo( is an n element vector, where is the number of tags in theXX( pattern. each element is an enclosed m3 integer matrix,tionXX( where is the number of hits (may be non-uniform if alt'n).XXX( the 1st column contains the indices of the entire match stringXX|( within the text being searched. the 2nd and 3rd columnstionXPnom contain the indices and lengths of the tagged strings.P(X( is an mn array of enclosed character vectors, where st inXP7] is the number of hits and the number of tags. thePX(!( character string represented by the th tag of the thH X@( match can be found in >Tag[i;j].' @x(Xh( the argument, is a vector of the origin 0 indices of the finalX8( matches located in the text.8 d((( origin 0 dependenttre(@<(ps 1 1 0 1 default display for arrays' @ Xd(t>Cvp[Q1] dFn p ( TagsTags[i/+\(tYlsub)-itYrsub] permute to order of appearance (rather than reduction)(p8U(ifi,,>(< 0 2)ա>Tags get indices8 *(i(ihits)/i X( ii[i]  H8( i(Q1,(Q1i)QN1i)/i unique, sorted hit indicesE(HX`5(Tag((i),Tags)Tags[cnt] (( t(t[;Q0]hits)t ll ( ( Tags[cnt]oop thrPecto (@RU shftlag86( 51(=!caca tpu [2HenhRM ifarac(@R (U "_15,(( (za shftl b;t;u ( ( : prefix p-array((( : boolean mask((( origin 0 dependentll ( pX(u>a[Q0] @ d( z(u)Q0  (tu/u `- (Q( z[b[t+>a[Q1]]/t]Q1tre(ght (shftrQ1tre((r of (=!(Xp pX (U', d(zn shftr v;io Xh( shift each element v[i] of boolean vector n[i] positions to theTrX0( right. n is scalar-extended.0`((ioQ0 (z(v)Q0 @ ( vn+v/v  P( v(v[0 1 2] is the original p-array before closure was performeds-X8U( [3] is a boolean suffix mask8@( is the p-array to be shortened'[@((( origin 0 dependent( p((Q4=p1)l0 n X( p1p1,<(>p1[Q0])Q1 if no suffix mask was provided, generate onealX0(l0:zp2 set default result t0X|((Q1/l>p1[Q1])Q0 fetch original length vector, is it empty?thH X@@((l.QQl)l3 non-scalar length attribute?ts@Peml(^/suf>p1[Q3])l1 do we have a non-trivial suffix vector?tsPPbtv(tQ0p2[Q1])-QQl no, subtract scalar lengthp1[Q2]P0(z((>p2[Q0])\t)vp2[Q2] 00( Q0 assemble result and exit00X(l1:t(lQQl)p2[Q1] [24] T0`( vt/v @<( b(>p2[Q0])\t remove hits of length cells@@((v)l2 if nothing remains, we're donesbl[@ x(vv+b/b @ (`d( u((v)=vv)/v(( (qu.-suf/suf 0t)l(X( qqt(q>Q0)^Q0=(QQl)q calculate distance between the end of each hit and each suffix vector positiononlyXX(tv(/q+t1000000)[uv] select the smallest positive difference inX \(bb\t @؍( vt/v build boolean and length vectorss' @(;(l2:zbvp1[Q2] ask(0d( Q0 assemble result ,exit0`(l3:'''closure of variable length components not yet supported'' signal 999' we don't know how to handle this yet=(ntex (U|suftreet)l(@3]  ]  (=!ma is a vector of integers describing the suffix set ofnX M( node .dFn X((`d( origin 1 dependent(0p(zQ0 initialize empty result0X(!(lp:(/o/ttree[; 2 3]-n)Q0 look for references to this rowhH X8U(noQ1 get pointer to referrent row 8Xh((t[n;Q1]^Q3=tree[n;Q1])lp are we the left son of a catenation op?lXX`5(l0:(Q0 a terminal?ds-XpX8(((optree[nn;Q1]) 3 6)Q0,l0 if op is <,> or <>, visit right son, otherwise, exitp8v(terminal:zn-Q1 adjust for origin 08leng@(R synthesizeio((spr [1<=! [X: e  :8[1` cxe 1=14 o0 pex  ,> 5  ty8pipare]  ar8 [f';s', obX)/ g pad na P9] ) (er `so ? !CR x!' "(> #,( H$re %])(%o,P&ne'e ( `) p)s?)Q *[QH*])+hi, a8- a.io.3] /[A0Q10Q1 l81ncx2] (A,i1`de J UR Lp H`lnity f`8P(zsynthesize;cf;flg;index;la;ptr;Tagn8P [8 generate stack code for production about to be applied.xit [4PX(!( primary data structure is semantic stack, , whose columns areX(a( defined as follows:(`(*@( column 0: row tag if active, 0 if inactive. @S(H( column 1: 1 if closure leaf below, 0 otherwiseE(H(H( column 2: operator index, or 0 if indirect stringE(H(X( column 3: left argument (0 if monadic, negative if step number,p?lX8( positive if string index) 8(810 X|( column 4: right argument (negative if step number, positive ifhH X0` ( string index) 0o1 H( column 5: tag number if node is tagged, 0 otherwise(HLnsflag oX`5( columns 0 and 1, as well as rows for indirect strings, are temporaryXPemt and are removed upon recognition of the goal production.StatPt-n),flg(( origin 0 dependent;t(8U(zQ1 assume call is successful row i8p(flgTagQ0 flag indicating that the code fragment creates a boolean mask which requires special code for p-array conversion`(Stateisgoal,isdop,isdop,ismop,ismop,ismop,ismop,Q0,istag,isid select branch target based on production numberet=(`~*-isid:laId>Ids[Stack[Q0;Q2]] retrieve identifier name for this stack level `X((6 7 8 >index(9TRMC)QQId)/spechar,isccl,synerr identifier or special symbol -- distinguish whichnonlycf(((la>Q1)/Tname,' pss'),(la=Q1)/Tname,''),'av[',(avId),']' set code fragment for primitive search/@(XX(idcom:flgmskcf branch if fragment requires special mask conversionrX8v(RelcfRelcf,cf't(',(la),') 0 0' e8H( gensem generate computed identifier code fragmentE(HxPy(mskcf:RelcfRelcfcf'i(-/((+/it^\t),2)t/t)0 0' generate code to convert a mask to a p-array(xX(gensem:SemstSemstQ6Stack[Q0;Q2]+Q1 add row to stack as a new leafX( (LaLa,Q1flgla,QN1 (8( Q0 set length attribute, exit@(.8pX8(spechar:cf(6 5 'SemskIdmskNnmskQrmskDimskLnmsk')[index;] generate code for _ ? pX(flgindex 1 2 4 flag indicating that we're dealing with stringXИ(la~index 0 4 length attribute is zero for syntactic delimiter and diamond, and unity for all other special charsd p(R(Cfflg[index]Q1 eetiona(Pt[t idcom indicate requirement for nontrivial mask generationdePXo(isccl:(lacfccl)synerr,idcom generate code for character class.Xhx(istag:ptrQN1(Semst[;Q0]Q0)/Q1Semst tag reduction -- pick up last operandack dFnhPSesTagQ1++/Semst[;Q5]Q0 compute number of this tag entrym:(Q2P0r((Semst[ptr;Q2]=Q0)opcom ector0(P( Semst[ptr;Q5]Tag 15,((@( Q0 if direct pointer, mark row as taggedle @@<(ismop:ptrQN1(Semst[;Q0]Q0)/Q1Semst s' @HP,( opcom monadic operator -- pick up last operandE(Hh(isdop:ptr2(Semst[;Q0]Q0)/Q1Semst dyadic operator -- pick up last two operandsnh`emtopcom:(Q2=flg(/Semst[ptr;Q1])+StatePRODCLS)synerr reject nested closures`h0j(indexQ1+MC' (~*+-) '[State] compute terminal associated with this productionorFnh  (GpnGpn+Q1 dFn `;Q] SemstSemst(-Gpn),flg,index,(2Semst[ptr;Q0]),Tag add new quadruplemst[;Q0`P0  Cfflg[Q5]Cfflg[Q5]State=Q3 turn Lnmsk flag on if op is ~comP((Semst[ptr;Q0]Q0 niffer(@@( Q0 flag these rows as used, and exitsbl[@@(isgoal:Semst(Semst[;Q2]Q0) 0 2 Semst cells@X( Q0 goal production -- discard temporary id rows and closure columnsX8}(synerr:zQ0 all errors come here.' 8 [30( -l trmc x) 7] ((=! i@tahe lu01,s ndng8 po` x mo ec f Xro21 opep umsu24Q@nd`atfratanh (peHfoco25is 0,i ,i ,i ta el  t @d ctio8P (" H"TX)row i8@@(pattrmc arg;io;b;cpm;end;j;l;m;pat;start;xuct@H( translate pattern to internal meta-char format.;TagE(H(PTM result is a 2- or 3-element enclosed vector consisting of thePX( operative compression mask, the internal form locator template, andsX@<( the (optional) internal form action template.@(X( assumptions are made concerning the composition of the globals ,X((( , and .rmc((Ppa contains z-code meta-chars for locator templates.rs [27]P8v( contains z-code meta-charsdFn 8XX( for action templates. contains y-code (translated) meta-charsXP[ in the same order as the unique chars from the set MC,MCA.e P(810 X`5( for logos, is a four-element nested array containing theleafXX|( locator and action templates, followed by their non-escape masksonrX(( (courtesy cp).(S(`(ioQ10(cpm(>arg[Q3]),>arg[Q4] ;xro0H( pat(>arg[Q1]),>arg[Q2] split masks from patternE(H ر(mpatZesc dFn  ( xmQ1m,Q1 (jxarg[Q1])m)Q1 1's mark action templatepm^x^PX(x((barg[Q2]) @ p d 5] i  em X [ /u ; 0 P r hng ne Q (er P [ ;Q [n  b pr g @at pd de so (t Q0 0]) p a bt ul juri ro  HiP Pntosi roHn x2]noinel  s8 f re@t `h mntoin n 8 mPfip it  j1rs !"#$%&'()*+,-./0123456789:;<=>?@ABCDEonly (99 xled er;lx;trap;pdamsk;xled;Adndx;Agf;AD;ADN;ADV;AFL;ANM;APM;APN;CMDDIR;DSEP;Fd;Fdndx;Fl;Fln;Flr;Flv;Fp;FBV;FTAB;GCD;GRP;Hpn;KEY;KEYS;Lck;Lev;ME;Pdcn;Pddod;Pdndx;Pdorg;Pm;Pnl;PD;PDN;PDV;RET;TERM;TNL;TNS;WKDIRxPy( copyright 1981 1982 ipsa: lhg,mde-12jul81 03jun82 21sep84 *xled* apl full screen xled editor !!!(x0X6(trap' 0 c signal 4er'tar00((0=nc '99')/'99'''''f the005(xled(99,' ')[io],01er0H((xled(names^.=' 4444 xled ')/nums)6 E(HPrte ' 4444 xled ' stie(xled((20)0,nums)0),0b)/patP @ (trap'' @dFn ( 99('Tn' pack xled) pins('Rc' pack 11) pins('Buf' pack 99) pins('Name' pack er) pins 'Qio' pack ioarsd p((pdef read(xled,23),0 ( ( er''  ((( trap' 0 c ',12 (( 12(Ȍ(trap' 0 c ',12 ( ( lx'',13 0h5((0=10'Name' pval 99)11e 00H(9999 pins 'Typ' pack,4 ^x^0`( 9999 pins('Typ' pack,2) pins 'Rnp' pack read('Name' pval 99),0 vel `S( 12@<(9999 pins 'Typ' pack nc 'Name' pval 99 @hx( 9999 pins 'Rnp' pack1((3='Typ' pval 99)/'''1 fd'''),' ','Name' pval 99 dFnh(xled H( ('Rc' pval 99)8,0,15,17,20,23,22,24,25,14,28entE(H0ȏ(9999 pins 'Rc' pack 9 0( 12(('Arg' pval 99C>.rmc(H(('Mfl' pnc 99)/'(2=''Mfl''pval 99)',29 ernE(HP ' trap' 8 o c (''Mfl'' pnc 99)'''' ',(16),trap [28P(P( er'Arg' pval 99 (@@( (2=pnames er)/'er''**package**''' bl[@0 ( 9999 pins 'Msg' packer 0(R( ('Mfl' pnc 99)16 r(( er x( er( (trap' 0 c ',12 5,((0( 9999 pins 'Rc' pack 1 0 1200(er,5 ws 'Arg' pval 99 Stat00p( (1 2 =er[(er0)1])/18,19 o00( er'incorrect data type' lg[70MA 12nd@x(9999 pins 'Val' pack cr 'Arg' pval 99 @26 16b 161])0` (er3 fd 'Rnp' pval 99 00( (er(0=10er)/er)25,120H(('Rnp' pval 99) replace 1fi 'Name' pval 99 ise(Hce 25] @H(('Name' pval 99),'''Rnp'' pval 99'gedle @((('Tns' pval 99)27 a(0r( (1<'Ord' pval 99)26 00 ( 9999 pins 'Rc' pack 5 0ce 12cpm@(names[numser;] erase er'Tns' pval 99. @ (996 12 1 ] s 0cpm0P (er,5 ws 'Arg' pval 99 Q2] 0X`5( (er((1=1er)er[(er0)1] 1 2)/'incorrect data type')12 XH8( 9999 pins 'Val' pack pack 'Arg' pval 99 ngE(Hm  16ark (' ' - 0( arbout '' P( (er)29 c (a( (' '^.=er)16N1 (@d(trap' 8 11 o c ',(29),' 0 c ',31 te?ts@8( 9999 pins 'Msg' packerer n8 pt er 10 293]  x(5er[io;] 0( (1,er[io+1;]'')er nents 0)<0 29N1 ms(("descmsk.rmc(i [5]!(=! le/H' `xl ((ms`   p0 pH pa nsckPs(cks k pHxlh ra',[8'02 H1x0= 110Tyh 8U ((U,"d_@p8(R(zescmsk v;b;lb;q;t;u(8( generate metacharacter escape maskn;u8 S(H( the argument is a character vector expressionE(Hp(H( the result is a two element vector of enclosed arraysHX`5( the first enclosed element is a scalar return code. a value of 0XXX( indicates that the line is valid. a positive value represents anonrXX( origin 1 offset to the location in the line where an error wasleafX 0( detected.dFn (X( if the line is valid then the second enclosed element is a booleanrsXXo( vector with 1's marking potential metacharacters. 0's correspond>,XX( substrings which are quoted or enclosed in braces. note that thedsXX(!( enclosing quotes or braces are not escaped (e.g. the correspondingH X8( element in the mask will be 1).w i8а(16ark  (z0(v)1 0(&((/(qv'''')lbv2META)0r0 5((/blb)l1 F 06( bv4META any braces? 0(P(lp:ub/lb left braces(0((/u(\q)^\tb\u10,u)l0 0(( b[u]q[uu1]0 16 r(( lpcpm(l0:btm0((/t(v4META)>bq)l1 b)/pat0 (i( z(2+t1)'' d Pf n 0 return error code if an unmatched brace is detected(1+v)P(Ȍ(l1:(1t\qb)l2 ( ( z(1+v)'' 8P( 0 check for mismatched quotes>(Fn 80<(l2:z0qbt build result [280') rALF( `ev@@pileabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567891] `  FLN(  (SFLR(  /FLV(  I24( ?  PMC>( 0ps{}()*+~-_?[]0 sMCA( Q@ 0mMC2( 0`^a{},)*+~-_?[]0  fMETA 0lav{}[]()\+=?'0(59PRODCLSize7 (( d as:((R83PRODLENS7 (H0l piE(H(( 1SYMBS u((( ( pQTxt( 8veck and ablaze ark blanketnket8(8[5 TABLE1,10 Q(0    #           ! w te OTRMC 0Hec0 (>Ydel 8K PYlbr t( fdYlsub5 (( nc Yminus,4 l(  QYnot  S(av[YplusT1(8K rYrbr t(acoraYrsubw or el(( z' Yrtacketurn (([i lpYstarference( S FZesc 8K(  ',(ZlarrowQ1Cu(t( jt, t(((r OSSPATMATCH ;m;t [(@( DanB 19970916 pattern matching fn for OSS the@ ((1+'')/ (@( [r/r\'']1av(0([r/r1av]av[156] Q1] 0 ( r()0 0@((2m>'''' pmatch )l10 0S( m ( 0(X(l10:r[0 1 m]1ute bot(p=$$eon(Px@h0X Hp8`( (xmskPx((  @X((XV x@ (( @ ((8x@(((H@h((8``@x8((/cfl(xX((`X@((Xx((0px((xx(( x((0 hx (( L 17!x!((0"x"((HL$x$8((kH%hx%((0'Px'x((kR,(((x(((0,x,(((user-0x-P((x.Px.x((/x/((81@18((01hx1((P>2x2((P3@4 ((5@@5`((`6@6((HL7@7(( =0x=P((>H@>p((OU>x>((P>j>?x@((AxA(( zi(translatefD((@ppalarp(=!B(pA(<(=(=((C(H@(*@(p Ȳ (j pT(translate ;io 8P( establish correct translate tableFnt8(io0 (0V( signal(^/av)11[( (Freq[FREQ] (8x( BLKS128Translate>((`vC( FREQ  ( abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 !"#$%&()*+,-./:;?[\]{} '<=>@^_`|~/( sax   (i  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ whe (8x(^/none11[( Љ(t $  []();/\+-*^<=>,!?~_ܭ}{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789. ':  |`#@"%&徼е뱿[16] (@ ]stsclate( 'u)  !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~ ӥħȫ̂쭵ܿᰯýϩ֢] P Xcav( _(tABCDEFGHIJKLMNOPQRSTUVWXYZ )<=>]^,+./0123456789([;:\_'*?~-abcdefghijklmnopqrstuvwxyz{}$@(0F21 2downloadfiletoPCqC(0АE( (=!<(<(` <(8H<(0(: (LIMNDn@0@h (spfn downloadfiletoPC tie;Limits;handle;T;xpr@P Left arg is fn to apply to each component. Default .P(8((nc 'spfn')l10 (XFC(( ( spfn''@dFn 0(l10:spfnspfn,(0spfn)/'crlf' 00p( handlepreparePCfile PCfile00(Limits 0 1 +2size tie0HH(xpr'((Limits,i)',spfn,' read tie,i)sendtopc handle'E(H0 (xpr fori Limits sendtopc0 H(close handle r[0 0@ dFnpreparePCfile@h@0H 14  (=!(`0`0 ( r'PPt08(handlepreparePCfile file;io;n;psdFn88U(file[n/nfile'/']ps'\'io1<(Fnt8(8((nfile iota ':')l10(((drive(n-1)file N( H( filenfileFn (`(l10:(ps1file)l20 @((( cd ps  ( file1file 00(l20:(nfile iota ps)l300 `(cdm(n-1)file  p( filenfile ( l20((l30:handlecreate file((lecPCfilefile(0n:C:\TEMP\SHARPAPL.FIL0 &fori ( p(=!p0H p(8 (R&20 @(( (ExP fori N;i;F 08m(i''N2io,N-io<1=,N ut 00 o( 2iN1N ((fx>'F'ExP'Nii+1'(0(F8P(*.mrd.utility.util.fns:[2]--Ö'k dFnt8>((>sendtopcU(^ (=!(@h0j (>jT%U8t00j( sendtopc ;io;blk;s;bsyner08U(bsPCBlkSize'PCBlkSize' default 1024t8(io0(8(l10:(s)end ( j( blk(bss) ( bs m(blk write ( l10x(end:(close<(Xot pH(=!;hHan pchH xk (jV `(close  m(Hds 'c',@dFn 8P(*.mrd.mrdlogos.ws.duplicates:[1]--;8:r[0(8O>iotaX<((x GXXvnam=! ck0stH Zp7 16e1 ZC7@2 h 50 ex  ma  s 0 (>j "\0(8p(r iota ;a;b;io(H(io1((((10)10)/l1((x(((2)^(010))/l0(0(signal((2)^11)/110((0r(r)r(,),((0(l0:(() 0 1 ) ((( (() 0 1 ) (((aav׬av[256]@(( (k(ba<1+r1 0(r[b/a]((~b)/a)[1+(b/b)-r]-r0(@(r[(/ר[r;])/r]1( (0r(r<1)r (l1:r(1)0W 8U(*.mrd.utility.util.fns:[3]-)HBk dFn8:r[0x(drive<(/ 1 2H(=!oohH>,d 1,H  (jX (drive  Ho(Hds 'd',@dFn 8P(*.mrd.mrdlogos.ws.duplicates:[1]--/ie8 Lcd pvaH'=!p'hH'A9H p (j H(cd  M(Hds 's',@dFn 8U(*.mrd.mrdlogos.ws.duplicates:[1]--)q!8H PNscdm P600vX(=!>(X@(>(<(C(A(X(0 (;s,( 0(cdm dir;trapn 0B(md dirtrap'541 c l10'W(0( L(l10:cd dirtrap''cdm(8P(*.mrd.mrdlogos.ws.duplicates:[1]--Lx8+=(P(create(0? [2X(=!>(xX@(>(<(C(A(X L (Dj E(create ;io (io0 (0( TranslateHds 'g',(8U(*.mrd.mrdlogos.ws.duplicates:[1]--8t88\=(0 @Hds e [1(=! so f ver ] 81 X[4p)poin @ (Dj x?(Hds ;iodFn (io0 ( Vmode (k( Xmit Command Hds(@( Quit  PN( Signal a ( 18P(*.mrd.mrdlogos.ws.duplicates:[1]--~48rs, (Vmode(8(25 FH=! hHeil;nH  ( H(Vmode`(arbout((4=(2 ws 3)[11+io])/ 27 85 27 111 33 6 27 111 38 13), 27 32 99] dis`8U(*.mrd.mrdlogos.ws.duplicates:[1]-->Z8ile 8 x=_b@Xmit 0z8 18(=! Hh0`0 (Dj_8D0 p(Xmit ;nowFn (A(ToFreq BLKS[0], Xmit( @( ,CheckSum (L1:arbin ^ 0x(L2:((4)CheckSum 4)L1s 0(k(FromFreq 4 (00( (21nowTranslate1)L1t wi0 ((6now)L0 0( (BLKS[0]Translate[now])L00  (arbin0 `( L2 (L0:1 ca @( BLKS1BLKS 8P(*.mrd.mrdlogos.ws.duplicates:[1]--80(HCommand( l5426H2=!hHH  (Djc @(Command dFn ( (Translate[ipsa](8U(*.mrd.mrdlogos.ws.duplicates:[1]--jH8 hQuit nonH=!hHH Ȧ (d H(Quit((Xmit Translate[113]uit(8P(*.mrd.mrdlogos.ws.duplicates:[1]--{8( Signald](P600>QX(=! [xXre kSL1n X  (je (Signal @dFn (k(((1)1Translate)0(8U(ERRORS[Translate'';] signal 541Fn88P(*.mrd.mrdlogos.ws.duplicates:[1]-->=8:[1]P(kToFreqe)0(($stkH=!chhH zemaH  (Dj_ (ToFreq ;now Hh((now31)/now((now) 31 34)+now, 3 93 FreqE(H8(*.mrd.mrdlogos.ws.duplicates:[1]--t)8patt( xBLKS 0PSis0(xCheckSumF4 c(xH=!]hH1f':H S (Djg (CheckSum Fn 0((32+ 32 32 32 +/),13s [208pZ(*.mrd.mrdlogos.ws.duplicates:[1]--8crea(0FromFrequtil(08readH=!hHH 0 (Dj_ (`(FromFreq ;now(H(Freq[0255(~now)/(-34)+9310,(-31)now<34] H8(*.mrd.mrdlogos.ws.duplicates:[1]--j80(Ⱥ ChecTranslate(   max  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ӥħȫ̂쭵ܿᰯýϩ֢0 c  Freq  .mrdabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 !"#$%&()*+,-./:;?[\]{}'<=>@^_`|~ ӥħȫ̂쭵ܿᰯýϩ֢ts [ (ipsareqd.ut( mrd.  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ӥħȫ̂쭵ܿᰯýϩ֢s [2 (0ERRORSd note(@h )normal completion invalid function number file not found path not found to many open files access denied invalid handle memory control block destroyed insufficient memory invalid memory block address invalid enviroment invalid format invalid access code invalid data invalid drive was specified attempted to remove the current directorynot same device no more files syntax error in command string buffer overflow of data disk full error input buffer overflowed by host unknown command file already open error bad file name abort from critical error maximum checksum errors from pc vpt bios error maximum nak errors from host maximum timeout errors from pc user pressed abort key o@ md t  H =!/lhH2t t H x (j S(md  R(Hds 'm',@dFn( 8pZ(*.mrd.mrdlogos.ws.duplicates:[1]--߹D8] e(0 PCBlkSize((j>default)/l0(@Po  29 FX=!miX]  B m 1:X( (j>jsro((x( default ;trap;er(((trap' 0 c 0',),(H(8(*.mrd.utility.util.fns.[2]--;1Ak dFn8rd.m@(writelt),(xmXXes [p(=!p 8p  (>j x( write ;ion H(io0 ( Vmode @Q( Xmit(Command 'w',,((~',')/','),';'), ver@8K( Quit  ` ( Signal @ x `  crlf hhnt;Qa=! h(@Xx P( (<( P(rla crlf c;io H( add CR,LF to matrices or change CR to CR,LF in lists(H`  left arg is limits (2), counter. Used to skip 1st case (no 1st CR/LF)current`(io1 (0( first=/ 1 0 1 /lacrlf( ((2cc)mat ( list8K(rcCR  ( c(1+r)/c k (( c[(+/r)+r/r]LF ( x( firstend (cCR,LF,c @ @( endXh|(mat:c(2first)r/,CR,LF,cr,1,1,\' 'c remove excess blanks X((end:rc=(Px@h0X Hp ](`parms((`  ((` ((0V((P8((>(((( L&H&p((؍D8DX((؍GpG((0AKK((`:',kOPOx((ThT((8sdpoo((Prr((sdpyy((8ont|H|p(((2=1}}((((8`(( (( ((PX((8Txms 8((HDnpc((P1s( crlfFOLD @ [4h(=!54htxx;@liXil f pw @t>Xoc lc ms=s exH h)/ l ln  l1 )/@ k` +1x h@Q (, Um&X:knlo'Lver@@0(ztxt FOLD spex;i;j;k;len;lin;msk;io;iln;nfoun@XИ( f , . tXH(io0 (( (0nc 'txt')/1+lc D( PN( txt' 'nq 8P(mskav[156]=spex1,spex,av[156] n8(0V( spex(~msk)/spex( (lenpw  ( ilnlen-txt  ( z''(8x(l10:(0=msk)/fin (Љ=(( R( imsk1 crlf P( msk(i+1)msk (linispex ` ( spexispex (kleni  (XV( zz,(klin),av[156] ( 6( linklin8D(  (n(i-k)iln 8K( j0((l20:(ntext)/1+lc 6] (0x( text1,text,av[156+io]p> i0h(onlyapl'ڡ^[]ABCDEFGHIJKLMNOPQRSTUVWXYZܯ'hXh|(onlynon' abcdefghijklmnopqrstuvwxyz@#$%&' X(r''  H( escav[84] ((l10:n/textonlyapl=(( M(rr,(n-1)text o(text(n-1)text ((0=text)/fin 0(rr,esc,'2' (u(n/textonlynon( @(rr,(n-1)text k(text(n-1)text 0 (rr,esc,'1'FOLD ((0=text)/fin 8K(l10  (fin:textr n is(xxypprint] ( val =!B(<( <(@B(X@(B(B(B(<(8B(X =(x B( B(B(0 ( Hxyz{[27] 008(pprint arg;nl;pl;lc;pg;io;pw0 ((0=,arg)/0Fn H(io1 (( pw''>parmsp[5](Pmbrsysprint av[157] BOX arg(>parmsp[20]) pinsertapl FOLD argfiP(0V(nl+/,arg=av[157]tapl( R(pl>parmsp[7] (lc>parmsp[17] (pg>parmsp[16] X(lclc+nlp- (pgpg+lcpl (lcpllcr (8x(parmsp[16 17]pglc=(((acidtc=(((S xFONT xZ=udk={{+174224ala-l {+274224ala-l {1{510,30,30,30,630 n x(8 "sdcloseЃB((((=!an(Phar(B(A( <(@=(x=(C(@(@(0h (; 8@ esp rr at t  @ x al11H (2  "<&p\@XH08(rsdclose;a;b;c;i;ec;iodex 0XИ( jsl 7-15-86, 9-26-86 close sysout dataset and submit for printingX(io0 t( r1 (h( (nc 'SDdat')0 ((`p( (2^.=svo SDdat)l4(0(l0:(cSDctl[2]1SDbuf)l3 g 0 8( bcSDbuf[;0] ( SDctl[4]l0a 8м(aSDtrn[;(256SDctl[3])+avSDbuf[c;]]8(P(a[;;0]av[1],[0.5] b (0( a((c2),SDctl[1]) 1 0 2 a 0( l2 (l0a:i0 | (`( (3>1SDbuf)l1 the (8U( ii/iSDbuf[;3]^.=av[64 215 211]8@(l1:aSDtrn[0;(256SDctl[3])+avSDbuf[c;]] . [@0(( a[;0]b find aplmail/, put0 x((1i)l2 FONT H( a[i;3]av[193 215 211] insert the 'apl' of aplmail/H0x(l2:(1,SDdat,''),'a' gen0@((0^.=r,(((1SDdat),4)',(1'),SDdat,')')0@(a'' 0( SDbuf(SDctl[2],0)SDbuf an n0 S( l00(l3:(1,SDdat,''),'0' r tag08P( r,(((1SDdat),4)',(1'),SDdat,')'8(k(l4:6 fd SDdat efile(P 6 fd 'SDbuf SDctl SDdat SDtrn' *.tools.sysout.prod.[4]-[P("<sdput@(( 89   t FO8,(=!ms8n  P h [2 xt  tP' axavex0ex`xen '' ( n  0 msx n pe 7] n)8 h[8k) [n< 8 'h  k 56 @li X11 z  F ta 8Pc' [@  "<&| P0`>(rsdput a;b;c;d;e;i;qec;io 0Per jsl 7-15-86, 9-26-86 assign data into opened sysout dataset=PH`( [char matrix char vector (with cr's) ]E(H(io0 ( r1 (`( (nc 'SDdat')0 ((P( (2^.=svo SDdat)0e((`p((2=pnames a)l0 he ((h( a'**package**'.5] b (0h(l0:bav[9 64[SDctl[4]]] l2 [6]00C( (1 2 =a1/a)/l1,l3 0( 08(l1:(a(~aav[0 1 158 159])/a)l2 n80H( cav[156]=aa,av[156]l[3])+00(e0/d1+d-0,1d1+c/c 00( a((d),e)(,d.1+e)\(~c)/a 0( l3 0(l2:bav[139 241[SDctl[4]]] 0 H( a 1 0 ' 'Fn (l3:r0  ab,a8}(l4:(SDctl[2](1a)+1SDbuf)l7c;]]8H(SDbufSDbuf,[0]((c0SDctl[2]-1SDbuf),SDctl[1])ail/H (a(c,0)a @ ( bSDbuf[;0] ~ ( SDctl[4]l4a 8P(cSDtrn[;(256SDctl[3])+avSDbuf]8 8((c[;;0]av[1],[0.5] b (0x( c(2 1 SDctl[2 1]) 1 0 2 c 0a l6com (l4a:i0 - (( (3>1SDbuf)l5 (8Z( ii/iSDbuf[;3]^.=av[64 215 211]?(88(l5:cSDtrn[0;(256SDctl[3])+avSDbuf] 80(( c[;0]b find aplmail/ flag0 ((1i)l6 H( c[i;3]av[193 215 211] insert the "apl" aplmail/H0(l6:(1,SDdat,''),'c' gen0@((0^.=r,(((1SDdat),4)',(1'),SDdat,')')0@.toc'' ou0( SDbuf(SDctl[2],0)SDbuf , put0a  l4SD08(l7:a((1a),SDctl[1])a a 0H( SDbufSDbuf,[0] a *.tools.sysout.prod.[5]-;aP.E(H1') 8(HsdopenE(B((nt rZ=! `m Pfaapn2 =o X=t[5  vn s) 8 x 'S 1 >  ,6 0 2 `f  c/ ta ( f @f)  ] te Xs) av 26 hi tu 0c P0] x 1 [5v0Hkf phaX [( '!4'"4]H"o #(($'c%]  &'X'vc(j) * P+Dd,(1-)(-daX.17x/na/ 0ut1umH2 3t'4(50,06196+6^.6wa62086;]`60r7 8 i8l1(9tr@:Dtp:,9;(<1/<~0P=SD>a[>S?20?SD@@] pAtlB4 CfuPDapE')E])8FSD`Gb H Hl HHIurpJ27KysKay8KtlXK bxL(l[1pt'h (t "<&X:)'$|Tx (LX0XИ(rsdopen a;b;bccc;c;d;dest;e;f;g;h;i;j;k;l;m;n;mc;t;io;qec;cc;p;jj;idXXh|( jsl 7-15-86, 9-26-86 initialize a sysout dataset for printingC(XP[16 d c w x a mGHIJPH( t: vtam, fast, full, apl, aplf, pn2, none(H@x( 0=o, 1=e , =tsio Dc@S(io0 0( r1 8P( svn(c,''runs)[1=csvn 1] dFn8 ( ex 'SDdat'n @(c 0 1 1 1 1 1 ^0=,1>ҡ>,>a6a,6<'' ')0@0X( f(2 1 1 ,f)f>''a08}(a[c/c]c/01132'vtam''''' 211]?(88( f(+/^\' '=f)f' ',((1f),8)f8 8(( translate filename(s)((cav @( c[166+26]'abcdefghijklmnopqrstuvwxyz' ')0@ ( fc[avf] 0C(k(2 1 1 ,k)k>a[5] (0 C( kc[avk] (h(m/(1f),1k 5 ( (( f(m,1f)f 0к( prepare & share ctl var08м(SDdat(((1f),2)'SD'),n'zi4' fmtm8@(375 svo SDdat,' ',(((1f),3)'ctl'),n]] . [@0*((,SDdat,''),'01 svc SDdat' 0 @>( jf 0 1 f ( i0aP((((2=svo SDdat)^.>,(((1SDdat),4)',(1'),SDdat,')')02],0)PH((d(names^.=' 600 sysout ')/nums)l0.E(H@0('600 sysout' stie d((2+nums)0,nums)0@@P(l0:c2g+/~\f[;5]^.= 2 5 'bway local'ver@@Q(f[c/c;](2 8 'n10r10 n10r0 ')[c/g;] foun@( i/c(`p(l1:(nc 'SDtrn')l2 ((P( SDtrnread d,9.5] b (0HC(l2:a(,>1a),<1/>a[4] taset=0 ( b~0kx- (`(SDctl0,1+,>a[2] 0 he (8p( SDctlSDctl, 11720 23440[b]SDctl[1]8`]aSDctlSDctl,17,((8 4 'vtamfastfullful2apl aplfpn2 fich')^.=4,>a[3])/8[19] ` =(SDctlSDctl,b (mc0 @( SDctl[4]l3 mc mercury @8(b'sw sysout=(','vfayaaaaa'[SDctl[3]]8H`(bb,',,',(3(3i>7=SDctl[3])'std1pt'),'),code=cm'ail/HPSbbb,',recfm=fbm,lrecl=',(SDctl[1]),',blksize=',2/SDctl[1 2]P0(b(((1f),b)bb,',dest='),f 0( l5 (l3:k(m,1k)k H((b(names^.=' 1 usagesystem')/nums)l4il/H@('1 usagesystem' stie b((2+nums)0,nums)0@@(l4:pdef read b,'bmufbci' pval read b,10 ;i@ ( untie b- 0(lm1000011,ccbccc29 a 0H(cc1(,cc)[1] c c m pE(H8(dest((1dest),7Ӣ1dest)destf(rs88(mc 3 7 'fax telex beeper ' l0:8P (dest[mc/1dest;7]((+/mc/dest[;7]^.=mc),7)'mercury'bufP8b(((1k),b)b'sw sysout=(a,'),kt]88th bb,'p,q)i10,,code=cm' fmt lt,'8X`(b[mc/1mc;]((+/mc),1b)(1b)'sw sysout=(a,cicsmerc),code=cm'X@(bb,',recfm=fba,lrecl=,i10' fmt(l)SDctl[1]@@(bb,',blksize=,i10' fmt(l)ҫ/SDctl[1 2]or c@0((bb,(((1f),6)',dest='),dest 0 ( SDctl[3]24a @(l5:b'''',b,'g<,copies=9''>' fmt(1b)>a[1]',@(P(,'',SDdat,'',b 0e((( (,SDdat),'FONT'(@h((0^.=r,(((1SDdat),4)',(1'),SDdat,')')l6@Xl((~/mc)l5bb ㉆ mercury , "aplfmerc" [2X(=((0=nc 'acid')l5a( H(tacid id29 H ((t7' ')l5a acid, (99999)HX((0vi 1t)l5b m m12345, ' (DC(XH(l5a:'314158 mercmids' stie jj((2+nums)0,nums)0 H h( ppread jj,1 ( untie jj Fn (( (~idpp[;0])l7 21] l((`( p(id=(pp[;0])) E(]@(((8O( p(p0)/pp^1+p ( ( tpp[p-1;1] Xt(l5b:tav[215 211],'fmerc:',(16,t),'/',cc,':' ㆌ aplfmerc X(@(emcf,':',k,'.' E(ؒA((( i10x(l5lp:((1e)ii+1)l5aa gen08a *e[i;](1e)(e[i;]' ')/e[i;] 88f  l5lp 㒅 fax :lieblich80(l5aa:t(((+/mc),t)t),e/ flag0@(SDbuf(1,SDctl[1])SDctl[1]av[64],t[0;] ,CR,'@0( l5c 64 is for fax,telex c 00(l5bb:SDbuf(0,SDctl[1])'' 0((l5c:(0f>a[4])l6 <((8,( b31900gts <<< correct for 2000ct80H(b[0]365.25b[0]-b[1]2 c)/a 00C( b[1]0.4+30.612b[1]-3c 0Pap"b(7 3 'montuewedthufrisatsun')[,71721119+693960++b;],(((1PP[1)e(12 3 'janfebmaraprmayjunjulaugsepoctnovdec')[,g[1]-1;]0] fiP@P(c'i7,g< at z9.99.99 >,3a1,x1,i2,x1,3a1,x1,i4'@X(e'apl sysout requested by ',,c fmt(29;10010033g;b;g[2];e;g[0])goXXo(c'dest(',((b' ')/b1,',',j),'),copy(',(>a[1]),'),wid(',SDctl[1]-1X8 Dc(SDctl[1]-1)c,'),tran(',(>a[3]),')' 8(N( e(SDctl[1]-1)eE(KC(((D(e'*',e,[0.5] c<(p(( e('*'e,[0.5] c),[io](>a[2])'morgan stanley confidential -proprietary information'p(0A((0=rsdput e)0 E(CC(((( (0=rsdput f)0 (0@(((( (0=rsdput '')0(=((h8(l6:untie(d)d ; bccc SDbuf SDctl SDdat SDtrn *.tools.sysout.prod.[10]-]3ck dFnh00 H(l7:'314158 badmids' stie jj((2+nums)0,nums)0 E(H 8( id append jj X( untie jj 0a SDa r9)0((1+2000)d1  -BOX   80 (=!79terPixapes( @ppl  t(؍ ( "\t( (ra BOX b;xdFn PGi b/u b () a (). h qbox.P(X((0=nc 'a')/'a20b' (( a2a 0@%( (0 1 2 =b)/l02,l02,l01 GHIJ00( 'data rank error ' signal 4]08%(l01:r1(,1,~^\a[io+1]=b)/,a[io],b 8`%( 00(l02:xx/xa[io]=bb,a[io] 0 x( b[x]a[io+1] 8( xx-1io,1+x H(r((x),/x)((,x,[io+0.5] 1)/,1,[io+0.5](/x)-x)/bE(Htex(fparmsp( 173130aa-l 510,30,30,30,600 0132 006674224ala-l 510,30,30,30,630 0132 006677497ala-l 510,30,30,30,630 0110 004577497ala-p 660,30,30,30,480 0090 006673755ala-p 660,30,30,30,480 0102 0075t10-p 660,30,30,30,480 0075 0055t10-l 510,30,30,30,630 0112 00507081a-l 510,20,20,30,630 0180 0075k10-l 510,30,30,30,630 0116 0050lg12-l 510,30,30,30,630 0109 0045lg12-p 660,30,30,30,480 0075 00507081a-p 660,30,30,30,480 0130 0100xcp14-l 510,30,30,30,630 0132 0066xcp14-p 660,30,30,30,480 0088 0090t12-p 660,30,30,30,480 0078 0055lg12-p 660,30,30,30,480 0078 005574224ala-p 660,30,30,30,480 0097 006673755ala-l 510,30,30,30,630 0132 005574372ala-l 510,30,30,30,630 0132 006674372ala-p 660,30,30,30,480 0097 0066(Ddputfontp(0@((`f 000000 0 0 74224ala-l 000000 0 1 7081a-l 000000 1 0 73755ala-p 000000 1 1 t10-p ex0724 0 0 73130aa-l ex0724 0 1 t10-l ex0724 1 0 74224ala-l ex0724 1 1 t10-p ex1828 0 0 74224ala-l ex1828 0 1 7081a-l ex1828 1 0 73755ala-p ex1828 1 1 t10-p ex4502 0 0 74224ala-l ex4502 0 1 7081a-l ex4502 1 0 73755ala-p ex4502 1 1 t10-p ex0729 0 0 74224ala-l ex0729 0 1 7081a-l ex0729 1 0 73755ala-p ex0729 1 1 t10-p ex5807 0 0 73755ala-l ex5807 0 1 7081a-l ex5807 1 0 73755ala-p ex5807 1 1 t10-p ex5330 0 0 73755ala-l ex5330 0 1 7081a-l ex5330 1 0 73755ala-p ex5330 1 1 t10-p (8Opfont([2(=!(](H1]xuc28de((~i0 x < 9] e, l[H se0]n eq(8O ()<((8(altfont pfont font;l;marg;string;udk 80( s f.10Xt( o f, .X@( o altfont 2.=(@`(X( a: d. d o: eq.ar c: 10/16/86goXXl( ---------------------------------------------------------------------XX`(udkav[83+io] -- u d k ( ) (XH(string 1 30 30'=','udk','=',udk,udk,'+1',fontx)/bE(H0 ((0=nc 'altfont')/1+lc ernati0@( stringstring,[io] 30udk,'+2',altfont@(a *@0(lfparmsp[;20]^.=20font00(marg,lfparmsp[;20+20]on 0@h(stringstring,[io] 30udk,'1',udk,'',margi4'@(N(8 sysprint string( (SDpag[8+io]0 p[Q(x sysprint;((evead H]=!eH Xfip [1v[] ud0 Pt x1119P ;i ' H- ` [2 15  ', N 0 P da x w fo or [2  2 1 8 p x [ [1 X 15  8 t X1 xpa (> )+ p 05] `[1  TE  R  8txX p[25^\ s0 Pfho;  H[2` 1 r] ] [4 @ `  1] 24 H x ] t 3] 7]H 8+p!, !0 !1 " # [X$3]$[3%]+% &c@&?p's[( t(s[) ()- P*x*7 *1 +r+ [+ , 8,tsh,yy-] -9/.10.',.00. H.ip/ 0p0i1o1~p(1s)X1sp2l2:p3),3rm(4 [@5pinH ( "<&X:)' $%spPd|$<l,Ph@H` Pc)lab sysprint c;d;e;f;g;h;i;j;k;l;m;n;o;p;q;r;s;t;io;trap;ec P(io1  Q( a 0 0 '' Fn P( (nc 'b')l0 ( b 6 0 p(l0:b2b  H( trap' 21 e (2e6+/size b[2])resize b[2] lc'(H ((b[1]=7)l3 (@( (nc 'SDsta')l1 ( ( (b[1]=6)l1 ( b[2]SDsta[2] ((l1:(b[2]<0)l2 <((@( bb,(1(b[2])l24,l23),1(b[2])l26,l25x>pa@( ('012345678'[1+b[1]] C((( l5 0(l2:b[2]b[2] 0P( ((f[1]) sysprint>f[2] ( ( (ef[1])0 E(]@(( ( 5 sysprint '' H( 01 l5:g0 @( (l6,l8,l9,l11,l13,l15,l16,0,l17)[b[1]+1]i4'@0xQ(l6:((0b[2])^0>c[1])l7 0Dbc t1 ou(( (0^.=ssdopen c)l29l((P(l7:SDcar 1 0 ,581 ((`( SDtit4< 0 0 '' ( ( SDnpc,0 gC6 ( SDblc0- 0Q(SDsta 0 0 0 0 1 1 0 0 0 0 0 i00( SDsta[7 8 9]SDsta[3 4 5];]] 00(SDsta[1 2](1132,>c[3]),b[2] 0(P( SDsta[11]SDsta[1]-9(0 (SDsta[10](0b[2])^~0>c[1]n 00(SDnptSDout(0,SDsta[1])'' 0c 0[21] @(l8:SDcar~~c[]  St 0]<(0P(l9:SDblcSDblc,1SDout ernati0(`p( (010c)l10 0 he ( ( SDsta[7]~~c 0[ 0l10: (C(l10:SDsta[7]1 0m( SDtit[2]<(2 1 1 ,c)c f.10c)l 0 SDs0(l11:SDblcSDblc,1SDout >(0(h( (010c)l12 .5] b ( )( SDsta[8]~~c Dbc 0SDou H(l12:SDsta[8]1 00( SDtit[4]<(2 1 1 ,c)c nera0c[ 0 [19((l13:(2=1c,c)l14 ((( f1,0''c2c,1 ((( SDsta[f/ 5 6]f/c (s)( D 0SDct(B(l14:SDsta[11]c[2] (0 3 0b]S xC(l15:gg+1 & $( f0,c & [2 c''l (l16:gg+1 BOXt ( L( ((2=c)^0=1c)0(1( x(l17:gg+1 @ 0( (((,0)c)^(0SDout)^g=2)00(@((2=cc)l18 ((H( hi=cc,iav[157]>((0(i0/j1+j-0,1jh/h x08%( c(1c)((j),i)(,j.i)\(~h)/cFn 80(l18:c((1c),SDsta[1])c first0 ((g1)l19 F %( SDnptSDnptc  %( qSDnpc  0p( SDnpc[q]SDnpc[q]+''c 00k 0] S((>(l19:SDoutSDoutc (:(((( SDnpcSDnpc,(1c)0 (( ( (^/qSDblc>0)l20:((((SDsta[3 4]SDsta[7 8] (((k( SDtit[1 3]SDtit[2 4] ( ( SDblcq/SDblc Pc 2l20:o(+/SDcar)-lSDsta[3 4]+.(1q>SDtit[1]),1r>SDtit[3]1PP5^k(SDsta[3]((1q),SDsta[1])q)SDsta[4]((1r),SDsta[1])r)[P((((g=3)0c)l21 ((lB(((D( ((g=3)^0SDout)b[4]( x(SDoutoSDout (x( SDnpc(1+o)SDnpc(S=((0h(l21:(o>1SDout)b[4]g=3 ches00( jSDcark(o,SDsta[1])SDout]0@8(pSDcar\SDnpc[1],((1k)0),(o-1)1SDnpc@(a *@ (SDsta[5]l22 (( l'page 5555'SDsta[6]((0(j[1;SDsta[11]+0,8]l c((( SDsta[6]SDsta[6]+1@((((l22:SDout(o,0)SDout l( ( SDnpcoSDnpc ( SDblcSDblc-o (P(pp1p(p+1)/p=0 (Ѐ<((0 1 jpj d( p~pum0(j[p/p;](h+/p)SDnpt or loop0 8( SDnpthSDnpt 18 b[3]y(8(l23:j append b[2] e( ( SDsta[10]l21 h(l24:t2 ;1] (Ⱥ( (0^.=ssdput j)l29 ((ysu t3 ')(`( (0^.=ssdput0)l29 (((n l21='8(l25:(0SDnpt)SDsta[10]l27,l26)' 8(A(SDnpt append b[2] d.ut( H( SDsta[10]l27 (l26:t4 jj,1 0`( (0^.=ssdput SDnpt)l29 E(0' s t5 (((HL( (0^.=ssdclose)l29<(( (l27:fl28 29 ( a,SDsta[6]a P)'l28:ex 7 6 'SDout SDsta SDtit SDnpt SDnpc SDcar SDblc ' 18] P  0 if H*(l29:('sysprint error ',(s),' at ',t) signal 500;udk(H`t ; SDblc SDcar SDnpc SDnpt SDout SDsta SDtit *.tools.sysout.prod.[10]-ܝ%t.p`18] (Ⱥ pqaddress<((p',(( (=!';ener@l  l1e (r `[2,'0 (I'sP\00(adrpqaddress;tie;n;trap0P r ( profile ).P@(trap'24 e l10 0 c signal fi 4er'p)/8@8Z('profile' stie tie1+/0,nnums dFn 8( l20X(l10:tie(names^.=(101ai),' ',11'profile')/n ---- (X8H(l20:adr'SPhspadr' pval read tie,6n 8@(adrav[156+io] BOX 1,adr,av[156+io]@(a *@(A(untie(~tien)/tie(] : ()pqfontessut(01H(=!c xHl11]P,[2=1( xc st f/( ]  11 0 g,c06]` ^0271 ct)H8]xchi=H0 () 0H8(parmsorient pqfont nonapl;id;l;font;width;lengthE(HP r , (/), .P@( orient 0 , 1 .@@8( nonapl 0 apl .@(a *@Xt( g orient, nonapl, --X@( fontp fparmsp.p)/8@P( i ' , P@( , 000000.4'@(X( a: d. d o: eq.ar c: 10/16/86goXX`( -------------------------------------------------------------------X XQ(id>parmsp[1] 0`(l10:lfontp[;6]^.=6id00(ll^fontp[;8]=1,orientE((?(00(ll^fontp[;10]=1,nonapl00(font,lfontp[;11+20] ).0((( font(font' ')/font((B((0font)/1+lc ( ( id'000000' ( l100@(lfparmsp[;20]^.=20font(x@(00@=(widthfi,lfparmsp[;40+4]00(lengthfi,lfparmsp[;45+4]0(`(parmsfontwidthlength(Dtit(8 pqprinter(pp2] (=!;o  f(sthowthz>orHrsing 0 (I'sP\00(idpqprinter;tie;n;trap0@( r .@@8(trap'24 e l10 0 c signal fi 4er'.4'@8Z('profile' stie tie1+/0,nnums dFn 8( l20Xt(l10:tie(names^.=(101ai),' ',11'profile')/n ---- (X8(l20:id'SPhspdev' pval read tie,6Fn8(((untie(~tien)/tiength(for (0 pfininterh( ? [2X(=!>(xX@(>(<(C(A(X  ( (pfin;udk@dFn (udkav[83+io] ((pprint udk,'+x'( (5 sysprint '' s:[1 8~fori 99 x(=!arx542 7 0 813h7  1x( (&(((EXP fori N;F;M;ifori(0z(i''N2io,N-io<1=,N (0 ~( 2iN1NdFn (Mav[156+io] 0H(3 fd 'F',M,EXP,M,'Nii+1',S0 (FH@( danb 83/9/27 will EXP for i:=N[1](or io) to N[2]E(H1 15(ptitle(( p(=!reptrr `ro). p | (x (ptitle x;nlFn 8%(xav[156+io] BOX 1,x,av[156+io]8 Xz(2 sysprint x (nl1x@}(parmsp[7]<(>parmsp[7])+(1>parmsp[10])-nl[@ ((parmsp[10]SD(((tstsfixms ts;io;m (Put( c ts ts m s .cP@X( (a 12 .) r ts.)SD@ (io1X (ts[4]ts[4]+12 -- a 12 ='XX((ts[4]<24)/0 -- c ?X 8(ts[4]24ts[4] ( ts[3]ts[3]+1 H(m31,(28+0=4ts[1]), 31 30 31 30 31 31 30 31 30 31E(H h(mm[ts[2]] ((ts[3]m)/0 H}( ts[3 2]1,ts[2]+1 -- c ?E(H ((ts[2]<13)/0 H( ts[2 1]1,ts[1]+1 -- c ?E(Hpage(Ptsfmt1(8s thH(=!54hHtxx;liH  () x(rtsfmt1 tsFn H}( f ts- ts mm/dd/yy :.E(HH(r('99/99/99'10011003ts),' ','99:99'10023tsE(H-tx8(pinitms S(!pp `(=!/`' xl ((ms( P ppppahns ck s(h ck s  k hpxl  rax',[8 'x2 10= `( (P((X(parms pinit dest;io(x (io1(O((~parmsparms)/l5 ( ( parmspparms  ( l10((l5:parms8(0),parms p( x( parmsp20<0 Xh(parmsp[1] ,,#XXt(parmsp[18]1parms[2] pqfont 0 -- apl .(XP),parmsp[6])1 -- H(Xh|(parmsp[16]<0 -- [2XXИ(parmsp[17]<0 -- cm'XX(parmsp[19]parmsp[5]),(<'vtam'),parmsp[9];idXP  1 sysprint>parmsp[12] -- 9]parmsp[18]) pfont>parmsp[4] -- & sX res(>stie0( pva(=!9al(rg9   ' H9 p9 1=2 0) nc( a h12 (0 (>jsC(0(O(r stie ;trap;io(XИ( stie the file and returns the file tie no. or 0 if unsuccessfulX@(O( rscalar if file previously untied or 0 @8Z( is an optional file pass numberFno8 (io1 8%( trap' 24 e tied 0 e r0'><(Fno8(X((0=nc '')/'0's p(0( stie(r((20)nums)0), 0 ( 0(0(tied:(1 0 vi )l1(0((101ai),' ',11~' ' 100>( l2@8(l1:(101fi ),' ',11(1+/5486av)@0(l2:r1((names^.=)/nums),00((>Dblcparse0:((re stpS=!htpap( vpms fnaHifro l8 X x  ]  1  ve0 atH [1h 8s ` it n' nd t 17 pQ0 r (r es H c xse ta g l 2 rr 8n- gt e? t  l o, Ple le l2 ,[ [(Hrpesrrs +/  )=H s! w" l"[2("TaH"fep#ho$ f%g (&((p&el'/t'+'2](no()ri@*of+ T+ce+l +da8,y,`-ck.1 .1 (/ b`;ch8 (V H?&$%D,DFnhXИ(parmspatn parse arg;d;e;dlm;i;p;pat;q;s;sp;sw;swit;t;D;;io;ErulXX( DAN BARONET 1993 - parse SWITCHES AND RESET ARGUMENT. VERSION L2.22(XP0k SPACES ARE USED TO DELIMIT ARGUMENTS. '/' DELIMITS SWITCHES. P@(O( QUOTES CAN BE USED TO INCLUDE SPACES OR '/'.r@Pc 2 SWITCHES CAN EXIST WITH OR WITHOUT [POSSIBLY DEFAULTED] VALUEPH( OR BE ELIDED. NON MENTIONNED SWITCHES ARE REFUSED.E(HXh|( SHORTER NAME ARE ACCEPTED BUT '=' must BE USED TO SUPPLY VALUES.idXX`( IN THE FUNCTION SWITCH VARIABLES HAVE THE SAME NAME PRECEDED BY ''X@8( OR CONTENTS OF IMMEDIATLY GLOBAL ''.av)@ ( EXAMPLE:@dFn X( cmdarg '/sa /ab= /sc[=] /cd=1 2 3 /e[=]d e f /=*' parse cmdarg[2X (Er711 (X( dlm1patn,'/' (@8( arg' ',arg DanB: added for LOGOS use @(io1  8( t\arg='''' 8H( s\swt(Pms PROCESS EACH sWITCH SEPARATELY ACCORDING TO THEIR pOSITION:cP(0(l2:(0swit)/l5 io( F( i1sp - ( siswit  E( switiswit0 @x(pat'unknown or ambiguous switch: ',1td sa[7]@0(pat signal(1+/itpatn)Er0(8T(pat1(\i)/patn (0( qd pat(1+patdlm)pat , 0 ( sp1sppa PDdt pat IS ONE SWITCH DESCRIPTION FROM THE patTERnS ARGUMENTsysouP(P(e''2(q)pat [22] (( ecm (( pat[pat'']'=' e((cm:t1 0( (/p2'[=]'pat)mem 0(( ('='s1s)l3,chk<(((0(mem:(/ppat'=')/comp(P[q+('no value allowed for switch ',pat) signal('='s)Er (^/qP( l3P((comp:('value required for switch ',s) signal('='s)Erpc SDP((chk:t(is'=')s 1@(( x( s[i]' ' rms (x( (' '^.=t)/comp ]l c(0( (' '^.=pat(p1)pat)/l3,00@X(p(e^^/tpat)e1q t=1ST quote(H(pts> DELIMITERS: SPACES NOT IN QUOTES OR 1ST QUOTEHXl( COMPRESSOR: ANY DOUBLE QUOTE OR LAST QUOTE NOT IN \ OR DOUBLE DELIM.X( (parms[p/p]1D 2 4] (8( parms((1q)p^1p)/parms<(Fn80x( DANB 1994/03/25 17:47), 0ts f(ppapfile/comp(((p18(=!/tx8('' [3@liXr pi-na] IL8,  RO TE (( lH s)p :i t ,(/' 2 H] xEAN 8@ؤ (. rItun@PParms pfile file;io;pw;ci;tie;Now;Tit;parmsp;limits;ci;getPH}( danb from d.duff 1998. dump file contents to printer(H0H( file may be name or tie no')[0x (io1 ( pw80P [5file'/= /ci' parsetiefile Component Info included?=1c)P(((010tie)l10 ( p( tiestie file 0XN(l10:file,names[numstie;]sou0P,cNowci/'((tsfmt1,ftt 2r),'' by '',11rrdci n),CR,'Dsta[1P(k(Now'rCR BOX',Now,'r'(P~cfx>'rget n''(2pnames rread n)2r''*package*'''NowP(((0nc 'Parms')/1+lc ( ( Parms0@ (D(Parms pinit '' b[4]((x( pw''>parmsp[5]S=(((((>parmsp[19])/l5[6](0`X(Nowtsfmt1 tsfixms ts00X(Titpw CENTER file,' ',Now SD0(0(ptitle Tit,[0.1] ' 'c(0((l5:limits 0 1 +2size tieDc00(('pprint get tie,i' fori limits0 h(fin:pfin fin=123  Hp8`(Px0( "Px((x((( x ((؍ Hx p((`vvsx(((E'gx((atis!x!((N'%x&(('x'(()x)(((( *(x*P(((+px+((ظ,,-((Qbrea-(x-H((.X,.((p/ x/H((0A0Px0x((r)m;x;((=x=((h9?,?(((?@,?`( 8-?x (?,?( (}-ra? }@@ (kdefault(@`@@@cf,x(=!54xtxx; lixil f pwx(k (E(:((0(?(0001 default 02;Ex;Rs;pw0Pkl DanB 2001 default var 01 by value 02. '' in name returnsPX( the value instead and '' will use of 02 instead of 02 itself.M.X0 W( Right arg cannot be a package0 h(Rs''01 Fn( 8$( Ex2(4 ws 0101~'')+''01Fn8@((,>1Rs01'00'),'',,>1Ex'02'0201@00 F`(stblot:((ll=!c;;f(;lpi;j 6,in( s@seti(1 1 1 ,t, 2 1 0 0 0 0 3)1,(1+t+t), 1 250 0 0 0 0 0 0 3P8Z(ctl1t 2 1 output12 2 1 1 3 5 280p(r(rav[254])/r,>1ctl06] ( "<stsetcloneid(h0HH',1X(=!0xXulRanau01 bX W ( (XV(stsetcloneid;cid(0( ensure proper clone id`(0(P((0>svn 1)0cid9999(Pa *(1=svn cidcid+1)lc loop until a valid CID is found(P02h(=signonE(08((Pur00a ch5(=! w P nti sP] inwa( WP t  ( )[  , 0 7]P he no si( o P ] citH3]p  @et h it nB t @ s [2 s ge 8ar xl( SK lc ge H ` 6 0 !tn !nb "n "to 0"k H#SK p#+ $ %0 1 XИ (D ,F(Ld<`xidXXt(rmode signon acc;v;svp;io;STASKMODE;msg;output;nbk;doneout;Tno:(XPd  sign-on account onto s-task. returns msgstring of task:doneoPX('acc' is account[:password] /switches. Only /Prod & /Zoo so far.M.XX`('mode' default io1 1=report trouble, 2=imm exec mode, 4=clear wsE)X@ؤ(mode, 2 2 2 2mode can be issued as list[@H(mode[2]/mode[2 3] clear ws implies imm exec modeE(HPdl1doneoutnbk0 o-u-t signalled, number of BREAKs allowedode' P(`v(STASKMODE'gather'(Xh|( svp is 1 or (1 3x,1,0) where 'x' is the nsvp number for system[2X(svp1 0( ('/'accdblacc)l10 font0 Ps( vacc'/' dFn ( svpSITES[SITES[;1]svp;2]), 1 0kD(@X( Blot for account number/password if '' or account does not match'X(XV(l10:(vacc':')/l15 (@( ((acc^.=' ')ai[1]1fi(1+v1)acc)l15in@P tmacc((~':'v)/acc,':'),v(')'1v)vstblot 'Signon/password:'P8(l15:initSTASK(fi(^\acc':')/acc),svp 80( Tnofi(STprefix)STASK 0@X( 0 0 1 0 svc vsvp svo vsvr vSTASKp@@x(l20:(2svo v)l20sc wait for sharePERLY9@0 (stset(')'=1acc)')',acc0H(outputTno stwhatis stget there MUST be output hereE(H((l30:(0vstbget)l40d(8Z(l30outputoutput,Tno stwhatis v=(Fn8H8(l40:msg'Not signed on' BLOT not taken in accountH8(msg signal(mode[1]^STS[3])111 >(Fn8 8( STS[3]end Pdow task signed on - are we in imm exec mode? do we need to?29] P(P(STS[1]endmsg''(Pmsmsg'Not in immediate execution mode' something running? moP0X (mode[2]end do we care?((0@8(STS[7]out prompt or stuck processing)SD@Pne try break 3 times, if that doesn't work report problem]endmP P(stbreak x- 0X( (4>nbknbk+1)l30dl 1(00(msg signal mode[1]112 0( end( (out:msg'in mode' eid( ( mode[2]end  a( doneoutl50 0`(msg signal mode[1]113 `(0(( end W(l50:doneout1 H( stout ((( l30 try o-u-tloneid(0(end:(mode[3]^0msg)l60 ]00( outputoutput,stsend ')clear'0@8(l60:STDATA[Tno;2]STS(1-(output)CR)output]@ P(rmsgoutput STS9P(XV initSTASKid(=!(x(Hh @ `  ((XV (%'$,(( (initSTASK s;n;p;v;io(PSA find a name for new S-task style CMDx and prepare its data')'P@8('invalid ID' signal(nn0.5s,s)111@(io1 8( sns keep acc# & nsvp id if anyFno8 (stsetcloneidFn (v'C' nl 2  ( v(0 3 v)v @x(v(v[;p]^.=pSTprefix)v all CMD varstput]@H(STASKp,n((n)n(2=svo v)/fi,' ',(0,p)v)0E(H0h('STDATA' default 0 3 '' oneo0 8 ( p6'' ci ( STS8 0 0 1 8$(STDATASTDATA((n>1STDATA),3)<''Fn8@X(STDATA[n;]STSps modenormal promptsid)SD@----(p'stwhatisKeid(0``2]  (=!;o  f(stxowthz>orrs(g (p (')D(((rn stwhatis var;l;io(HH ( DanB9602 find what is var's strings. Set STS finally(HP^ assumes var is contiguous and homogenous (no or arb)+0]P XB(rio0@dFn ((l10:l256av2var ( ( STSvar[5] X( rr,6lvar  (P( (varlvar)l10o(8Z(STDATA[n-1;0]ai[3]-in ((( loop (get:rSTASK ((@(`v;waistget;in(= p(=!a p [CRringP,Lp [ft ap(8x (P( (rstget;waitFn 8$( DanB 960208 get value from shared var8(((11svs STASK)get (8Z( 'no shares' signal(2svo STASK)110 8 H( lcsc@ M(get:rSTASK nd:r(stattnget ([? [2H(=! ihHriTS2]H آ ( (stattn@@( danb 85 send an interrupt to the s-taskntains@0(STASK,'av[io+ 0 0 2 0]' 02)(N clearstask(hH(=!hHH  ( (clearstask@dFn 8( sign-on (s-task); ensure clear wsFn 8 8D(7 signon1ai (ustbreak( 06 FX(=! xXhaian war'sX  ( @(stbreak@P( danb 85 send a break to the s-task (2 attns)(@(stattn PA( stattnvar) (ostoutak(0829 FH(=!;lhH invaH P] (U @(stout;bs@dFn H0( danb 850704 send an 'out' including backspacesnt c;H@(stset 'o',bs,'u',bs,'t',CRbsav[io+158].5,li@2)0(STprefix(( X@CMD dbl  (iH(=!hH"#./:;H  (%% H(sdbl s;w@dFn 8$( danb 83/10/12 SQeeZe out extra spaces80h(s1(w1ws=' ')/s' ',s to 0((SITES(x` @0@P@p@@@@AA@A`AAAABB(BPBpBBBBCC8C`CCCCDD(DH D((stbset(ز stsH(=!1 hH x C15H  (E>( Ⱥ(stbset str@dFn @( danb 850704 s-task var Bare set (no header)?(@ X(STASK,'str' C1 (streadp( Piz 0 02]tP.(=!0P0prx( b@]  ]) f[ @ (eh (>HE(p s 8 Xxl83,l1P:0  H1 h (0 n  ( 1 0 p 4   DnC6 PXt (B 'sLpwsE)XH(allstread;last;line;lmode;n;nul;r;t;trap;var;ioabE(H@(( danb 830923 read shared var from s-taskSTASK,@Hp( modified 841220 for multiple s-tasks and modesH8XR( again 900904 to handle 'attention'8X( It returns the output according to 'STASKMODE' in a prompt modeio:<(X8( arbin/out not taken in accountces8P0trap'1000 c line1lcbreak110 c el' attn, no shareseaP(((lmodeSTASKMODE'last'( H(rvarnio0 HX(last'' in case no result from stask in 'last' modeC(H (more:varstget ((l:nul6n256av2var(@(STS,(82)tavvar[5] s-task's stateder)?(@Xh|( one of the problems with s-task is to tell the difference between);XHPS( buffer flushed or not; STS will contain that info:H(p(STSSTS,nul^2t ttset s( ( nulel 8(STS[5]aout 0( (STASKMODE'gather')show 0 X( rr,6nvar ( el Ⱥ(show:nulel 8( last6nvar ا( STS[7]el ( ellastE>( X( if the last xmission was not arbin/out then flush output buffer(`?(X(N(aout:(r)moreaout om(8$( r0r result won't contain thatnb(80ȥ( BLOT not taken in account dat00(moreaout:signal STS[6]11 0(( arbout av6nvarhar(H( preceeding line only valid with non 3270 terminalsE(H( (el:(varnvar)lKid( X(STS[7]moreFn 0h((STASKMODE'noresult')0 nt to0( allr((((STASKMODE'last')0 m( 8( alllast (0 h(break:er ] @o( arbout 0'Sspend, Resume, Break ? '6<(0.5,@8(('sSrRbB'1)/2/0.5,line,sendbreak 8X( break(0(sendbreak:stbreak (B(( more0(( STS: global; s-task statuscom0S=( P(pstsend)0 m(0 48p(=!1 p x C15@pshx1C1sa11p(p (7sDar((((rstsend com;trap;t(HPS( danb s-task send/receive. 1st break sent to staskE(H8XR(trap'1005 c stbreak ok,trap0'8( (STASK,'(41av),com'(00[(ok:traptrap,'8 c 0' out 0 (( rstread@dFn C1 x(Nstsetd,com'((linalH(=!iphH xC111H [ (E (stset str@dFn @(( danb 850704 s-task var set (with header)KMODE@00c(STASK,'av[4io],str'ith 01 x1 `[CR>( 4  bLF:(  (STASK(( STASKMODE( `m@last `cSTS (YSTDATA( H7@finx P@aplc @zoox (6ipsaint( @prod @ipsa h@labx (ipsalab( m--tz (:ipsaint( j-[1p p@ipsa -OTf J@aplc I-12l (:ipsalab( @FINx x@aplc @ZOOx (:ipsaint( D@PROD `C@ipsa @LABx (:ipsalab( 8-ouZ (ipsaint( :-20P 9@ipsa -T F @aplc x-'tL (ipsalab(=ˀ(0 iPrint lines of 3270 session to hsprint (mainframe only) Syntax: ]prtlines [from] [to] /remo= /for= This command will send a copy of the lines of the session manager using a 3270 type terminal or emulator. If specified, the range from/to will limit the output. If only one number is specified it mean 1/TO if positive or (FROM),last if negative. This only works for systems offering hsprint or equivalent services.vices.0= F6 Simulate a card punch DanB 1996 Syntax: punch [inout] /report[=month(s)] /details /new This cmd will allow to punch in and out as many times as wanted even in the same day. It records the ts each time in a file so that /report can report the total time punched for the current month or the months specified (2 numbers range). Some limitations regarding month/year crossing. /details allows to see each entry on a report in details. /new allows to create a new file when used for the first time (otherwise a prompt asks for permission to create it) The file resides on your account. It simply records which component holds the data for which year/month in a 3 column table (account, year, month) in component 1.ring =a noRenumber labels in function DanB 93 Syntax: ]RENUM function /STEM=string /N=start(=IO) [increment=1] /X=names Renumber labels in function. Specific labels can be ignored by including their names in the code after a lamp/tilde (~) or by using the eXclusion switch /X. See following example: For example, FN [1] start: Dont renumber following label: ~ END [2] a1 [3] x: [4] y:and [5] so [6] on: [7] END: ]RENUM FN /STEM=L /N=100 10 /X=start 1FD 'FN' FN [1] start: [2] a1 [3] L100: [4] L110:and [5] so [6] L120: [7] END: i=˘Dvv Change all potentially dangerous system functions by user functions Syntax: ]securews This command will replace all occurences of potentially dangerous code by function calls. For example, replace becomes replace. This render the ws safer. Code paged in is not affected. The code will no longer run properly but it is easier to pinpoint security breaches this way.s way.=ː] 1 2Show object in UCMD file DanB 92 Syntax: ]SHOW object /F=file Display object stored in UCMD file. Loop thru secondary files until found. Result returned. If /F= supplied only that file is searched for.ab=X8(0 iReturns size of objects in decreasing order DanB 93 Syntax: ]SIZE [obj1 [obj2 [...]]] /N=n Returns the size of each object in decreasing order. If none supplied then all objects in workspace are shown up to N=n (default all). Examples: ]SIZE a B c same as SIZE 'a B c' ]SIZE /5 returns 5 largest objects in ws ]SIZE NL 2 returns size of all variables in decreasing ord0=scalars vectors matriceses=0MMC rsystem [1] DanB 961025 return system in use [2] r'Prod' qrst=˘ bb1 Tag object with date, ID and comments DanB 93 Syntax: ]TAG fns /COMMENT=text /EXEC /WHO=id /REP Each function in the list gets an extra line which contains the date/time, account id (or as specfied by the /WHO switch) and comment if set. The line is added at the bottom and the previous TAG line deleted if there is any and /REP is set,=Hz  18,1 ztimefmt ts;io;md;shape;tmp;ts;yr;z [1] from ipsa library [2] *** convert rdci timestamp(s) to ts-format *** [3] right argument: rdci-type timestamp(s) of any shape [4] [5] io0 shapets,ts [6] md365.25011+1461yrts5184000 [7] tmp 31 61 92 122 153 184 214 245 275 306 337 366 [8] z(, [5] io0 shapets ts,ts [6] md365.25011+1461yrts5184000 [7] tmp 31 61 92 122 153 184 214 245 275 306 337 366 [8] z(, plus those of the fns it calls and those they call and so on. Result is sorted.orted.=д@@ ttstofl ts;shape [1] from ipsa library [2] accepts a numeric vector or array in ts format with <71argument> [3] returns time and date in rdci format with shape <1argument> [4] shape1ts ts((1ӫ/shape),1ts)ts [5] ts((1ts),7)ts [6] ts[;io]ts[;io]+(ts[;io]99)((502000),(501900))[io+100ts[;io]] [7] ts[;6+io]ts[;6+io]6100 [8] t 60 29 1 30 60 91 121 152 183 213 244 274[ts[;1+io]-~io] [9] tt-(4ts[;io])<2ts[;1+io] [10] t(t+365.2560+1900ts[;io]), 0 2 ts [11] tshape 1 1 24 60 60 60 t (=x Transfer WS - COMPARE utilityility=1IA(Check a user command file for consistency DanB 2002 Syntax: ]ucheck {file} This command will check the user command file given as argument (default current file) for potential problems. It will look for valid file tables (list of names and components), that packaged commands are packages, that all functions can be defined, report the objects in the file that are not referenced, report commands without documentation and missing items from the "grp" variables.b=`tionShow variables in workspace with patterns DanB 95 Syntax: ]vars [patterns] /nofit This will produce a list of variables matching 'patterns' (ALL if patterns is blank) in the workspace. The list will be formatted to fit pw unless /nofit is supplied. Ex.: ]vars B* ** ??*8 Because the way user commands work internal variables may be displayed as well even though they do not appear in the ws.ATA=@ herReport or change a user command version number DanB 2001 ]version reports version no of file where "version" is found ]version 4/set changes its version no to 4 ]version /f=xx reports version no of ucmd file e e=ː99s ac rwhere b [1] DanB 19970919 [2] rb/b M.=GG',1Report name associated with ID (custom made) Syntax: ]whois number This command reports a name associated with a number. It works with object 'IDs' which must be a 2 column table of numbers and strings. For example, if IDs 10 42 666,[1.1]'digits' 'answer' 'devil' then ]whois 666 will return 'devil'am02=99 Drop workspaces from a library with patterns Syntax: ]wsdrop pattern /noconfirm This command will )drop workspaces from a library (default personal library) that follow a specific pattern a la DOS. For example doing ]wsdrop crash* would drop all workdpaces starting with 'crash'. A confirmation prompt is issued after showing the workspaces to drop unless /noconfirm is supplied. Note that this commands only works under SHARP APL with Stasks.15=(TraShow workspaces in library with patterns DanB 95 Syntax: ]wslib [lib][patterns] /lx /date /obj= /string= /nofit /public This will produce a display max pw wide of all workspaces if pattern is blank in the (personal) library. A list of patterns may be supplied. Result is any matching the patterns. Ex.: ]wslib 1234567 B* ** ??*8 Switches: lx show lx value date show saved date obj report wss with those objects (fn, var or grp) on stack or not string report wss with those strings in fns nofit do NOT fit result using pw (in column) public look in public libraries Note that with /public only the wss following patterns are shown. This command only works under SHARP APL.=Љ06 F RA xC1 B [1] DANB 83/10/12 CATENATES 2 OBJETS OF S ON 1ST AXIS [2] IF ARGS ARE EMPTY VECTORS THEY'RE REPLACED BY 0 0'' [3] A(21,(,A),A)A B(21,(,B),B)B [4] R0,1(A)B A(RA)A B(RB)B [5] RA,[io]B =˸!!18,1 ZlST xCOMPARE nEW;nG;nS;lL;I;gL [1] dANb 831012 COMPARE LIST AND ADJUST GLOBAL DEFINITIONS [2] nG''=nSnEW[;1] gLnGnEW 0 1 nEW [3] lL''lST[;1] * IS CALLING FN [4] ZgL xEQ 0 1 lST ONLY GLOBAL ONES [5] CHANGE '' BY '' IF THIS GLOBAL IS A LOCAL AT AN UPPER LEVEL [6] nS[(Z.^lL)/InG/nG]'' [7] CHANGE '' BY 'r' IF THIS GLOBAL IS A FUNCTION APPEARING [8] ALWAYS AT AN UPPER LEVEL AS A GLOBAL (A RECURSIVE FUNCTION) [9] nS[((/gL xEQ xBR)^Z^.lL)/I]'r' note: xBR IS GLOBAL [10] ZnS,nEW =Hbb xN xDF xOB;xB;xCR;xC;xL;xS [1] dISPLAY fUNCTION:DISPLAY CONTENTS A GLOBALS VARIABLES [2] gLOBAL: xVR [3] xN(xN' ')/xN xSxQZ(1+/xVR';',CR)xVR [4] xCR 1 3 CR xMV xVR [5] xB1+8xL1xBR xB(xB'LEVEL ',xL),[0.1] xBxL'....' [6] out '' [7] out xB,'',[0.1] 'FUNCTION ',xN,': ',xS [8] (xL1xCR)l1 [9] EXTRACT 1ST LAST PUBLIC COMMENTS [10] xB(10,xB)xBxL 1 1 1 xCxBxCR,(xL,8)' ' [11] xC 0 8 (+/^\xC'] 0123456789')xC [12] out(xC[;io]='')xC [13] out '' [14] l1:xB3=nc 0 1 xOB xOB[xB/xBxB^xOB[;1]'';1]'f' [15] out xFT xOB No=Xnn98 F Ba xEQ w;DO;DA;I;io;N [1] B a .r1 w ; (a ^ w) 1 2 [2] N1DAa DOw(2 1 1 ,w)w io1 [3] DO[DO]DA[DA](1DO)Ӣ1DA ADJUST DIMS [4] IavB(DAa),[1]DOw METHOD [5] I[I]+\B/B1BB[I;] [6] B(NI).=(/N)I ^.= BUT FASTER ^ SMALLER [7] AN a VECTOR WILL PRODUCE A 'B' VECTOR, ANYTHING ELSE A MATRIX =ˀ? [2 MATxFT MAT;D;F;P;W [1] REFORMAT MAT [2] MAT(\' '.MAT)/MAT [3] W5(1DMAT' ',' ',1':',1MAT)5 LIST'S DIMS [4] MAT((FPD[1]FpwW),W)MAT ADJUST DIMS [5] MAT(P,FW)MAT OPTIMIZED FORMATTING x>xx>=1  NB NBH xFr FN;io;b;c;d;e;or;os;q;s;t;us;C;I;LAB;LOC;L;O;P;T [1] dANb 921124 FIND FN'S LOCAL AND GLOBAL REFERENCES GIVEN 1fd 'FN' [2] BH BYPASSES THE HEADER [3] io1 CREATE pARTIONNED \, \ AND / FNS [4] Nfx((T)'RS os P;T'),[0.1] T'SSPR\S\T10,TS/P' \ [5] Nfx((T)'RS us P;T'),[0.1] T'R\PS\T10,TS/\10,P' \ [6] Nfx((T)'ZA or B'),[0.1] T'Z(Z/1Z(AB)/A)A/B' / [7] LOC 0 0 I,1 (nc 'BH')L5 [8] 1-FIND LOCAL REFERENCES- account for on [0] [9] IFNCR,'' T(N1+L';')L(+/^\L' ')L(1+/I)FN [10] b' ' xMV(P+/\''=T)T FN + ARGS [11] LOC(0P-1)T RESULT [12] P1(1b)-1 FNNAME POS [13] LOCLOC xC1(P1b)b ARGS [14] LOCLOC xC1 '; ' xMV NL LOCALS [15] L5:sCR=N(I[1]-1)FN [16] tEXT, bODY, cOMMENTS, STATEMENT dELIMITERS [17] ts us qN'''' eN SS '' tEXT [18] bcTt>cs os t<(1e)s os t^N'' until next or CR [22] L10 [23] LOOK FOR {...:...:STMTS} {...:st2} (stsc/apl) [24] P(1P,1+s)-Ps/s LENGTH OF EACH LINE [25] ts us Tc^N'{}' TEXT BETWEEN {}S IN COMMENTS [26] PP/(s or c^N SS '')^s or t^C MASK EACH LINE NOT FOLLOWING PATTERN [27] CPTP^t>(T) ost^C TEXT FROM LAST ':' BETWEEN THOSE {}S [28] bbT\=\''''T/N IS INCLUDED IF NOT QUOTED [29] INCLUDE & trap BUT LIMIT TO OWN STATEMENT. [30] L10:Pe(9b^N SS 'trap''') N SS 'nc ''' [31] PPb^(N SS 'ea''')(N SS 'size''')(N SS 'cr''')(N SS '5ws''') [32] scan executable strings [33] C 0 0 '' (1t(Tq)^d os P)L20 Cc\c/NcT^qq^1q [34] C[P/P]CR C(C^.'')C 0 1 1 xFr t/C [35] L20:TPtcd1 e1e RECOUP SPACE [36] fIND lABELS [37] P(d(s) osL)/N Ld\T\TP'[]' [38] LAB(+/^\LAB' ')LAB':' xMV L/N b,1,b>L EXCLUDE LABELS FROM bODY [39] 2-FIND GLOBAL REFERENCES [40] L'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' [41] EXTRACT NAMES [42] Tb,1,NL N,' ',N [43] N[T/N]' ' REPLACE DELIMITERS BY ' ' [44] insert ' ' before , or in case name before glued to it [45] N(1+bN'')/N N[(1++/b)+b/b]' ' [46] OC xC1 xMV xQZ N SQUEEZE TEXT AND FIND oBJECTS & add names [47] O(~,O[;ɫ1O]10L)O ELIMINATE CONSTANTS [48] OxRD O REMOVE DUPLICATES [49] FIND UNUSED LOCALS AND LABELS [50] N'Ll'[io+LO xEQ LAB],LAB L~/L [51] NN xC1 '!',(~TO xEQ LOC)LOC [52] NN xC1(L''[1+/T],O) xC1 e/' ' =ˈrsign xRxST xGENSYMB xBR;xN;xVR [1] DANB 840921 GENERATE NEW SYMBOLS OF FUNCTION xN FROM SYMB TABLE [2] 930907: CHECK FOR COMPILED FNS (stsc mAINfRAME USE) [3] xR(1,xR)xR'COMPILED' xVR1 fd xNxBR[''xBR;] [4] (16=1,5 ws xN)1 xR(1,xR)xR'LOCKED' (0xVR)1 [5] xRxST xCOMPARE xFr xVR [6] 1:xN xDF xR dISPLAY fUNCTION'S SPECIAL INSTRUCTIONS =ˀinal MD xMV V;io [1] DANB 840920 mATRIX REPRESENTATION FROM vECTOR [2] D IS THE DELIMITER, DEFAULTED BY ' ' [3] io1 (nc 'D')/L D' ' [4] L:M0,M/M(VD),1 V(~VD)/V [5] MD./0,D(0aadent RxQZ S [1] DANB 83/10/12 SQEEZE OUT EXTRA SPACES [2] R1(R1RS' ')/S,' ',S =˰<oo4) axRD a;n [1] REMOVE DUPLICATE NAMES IN A CHAR MAT [2] (0n1a)0 a((n)=a matiota a)a estam=yu xTREEGEN xF;xR;xN [1] GENERATE SYMBOLS OF F AND THOSE OF ITS SUB-ROUTINES [2] SEMI-GLOBALS: xML, HOW DEEP IS THE TREE TO BE SEARCHED [3] xFS, FULL SEARCH, RE-PROCESS OBJECTS IF NECESSARY [4] xST, THE STACK [5] xBR, THE TREE BRANCH IN USE [6] xNL, NAME LIST OF ALL FNS PROCESSED SO FAR [7] xBRxBR xC1 xF,xF [8] xR2-1xNxST xGENSYMB xBR [9] (xML1xBR)/x30 DO WE WANT CALLED FNS TO BE CHECKED ? [10] xSTxST xC1 xN STACK-UP OBJECTS [11] xN 0 1 (''=xN[;1])xN KEEP GLOBAL REFS [12] xN(3=nc xN)xN ... AND FNS [13] xN(~xF xEQ xN)xN REMOVE RECURSIVE CALLS FROM LIST [14] xN(~/xN xEQ xBR)xN ... AND FROM THE BRANCH WE'RE IN [15] xFSx10 xNLxNL xC1 xN(~/xN xEQ xNL)xN FULL SEARCH ? [16] x10:x20+01xN [17] x20:xTREEGEN xN[1;] (1xN 1 0 xN)x20 [18] xSTxRxST CUT BACK STACK [19] x30:xBR 1 0 xBR =pcZA(Cross reference a function Syntax: ]xref name(s) This command will show a cross-reference of all identifiers and their line numbers in a given function. It will also display , , . Each token (name, name, , , and ) is shown with a list of lines on which it appears in the function. Each line number may be followed by '' if the token is assigned a value or by 'I' if it is indexed or by ':' if it is a label.av[=88 zt addr b;a;h;i;n;t;u;io [1] returns the tie number and component number of the value of object b [2] if the object is not defined, the component number is zero [3] io1 (nc 't')0 t0 [4] 0:(t>0)/3 [5] (0=nc 'ufiles')/1 if ufiles is defined, [6] uufiles 2 use first file named in it [7] 1:uread MT,4 else read the list from main UCMD file [8] u(0,u[1;]']')u get search list from file [9] 2:tfopen(1u)u tie first file on list [10] 3:hread t,2 file head [11] aread t,h[2] nread t,h[3] names matrix and numeric info [12] hia matiota matrify b look up names [13] zt,[1.5] h\n[h/i;2] tie number, component number [14] ((1b)^1=i)0 z,z return vector if arg was vector with one name t =EE mallfns;io;allfns;b;f;l;r;t [1] RETURNS A MATRIX OF ALL NAMES THAT ARE FNS. [2] dETECTS NAMES BLOCKED BY LOCALIZATION WITHIN THE COMMAND PROCESSOR AND [3] DISPLAYS A WARNING MESSAGE IF ANY NAMES ARE SHADOWED [4] To do that we need to look at all the names in the ws (NC 1 2 3) [5] and keep only those with a visible class 1 (function) [6] io1 m2 ws 2 b+/~\/m'*' [7] b is the stack level for this ucmd call [8] l5 ws mnl 1 2 3 all the names [9] f1=((+/^\r=1)r(0,b)l)[;1] functions [10] lfl keep those only [11] Some may not be seen if localized without a value. [12] mfm [13] Fns found in the ucmd stack are denounced [14] (/l~rl[;b]^.=1)l0 [15] 'These fns are shadowed:',(t1tb' ')/b,' ',lm [16] l0:mrm = 0 0 0 0crfromvr 1;m;r ;w;io [1] converts a 1fd to a cr [2] io0 w(1+1'')1 w(/w';',CR)w w[(w' ')/w]';' [3] w(r1rw';')/w';',w 1(-' '=11)1 [4] 3fd 'm',w,CR,'[1]0cr 3fd 1' = 1 1 0 rr default value [1] DanB 1992 default CHARACTER STRING r BY value IF IT 0 [2] (r1)0 also a valid value [3] (r0)mod rvalue 0 [4] mod: r IS not SCALAR 0 - IF value IS NUMERIC [5] (' '=10value)/0 rfi r 0 0=== 880 tsftimerep ts;io;md;shape;tmp;yr;z [1] from i.p.sharp library [2] *** convert rdci timestamp(s) to ts-format *** [3] right argument: rdci-type timestamp(s) of any shape [4] result: ts-type timestamp(s) with shape <(argument),7> [5] io0 shapets ts,ts [6] md365.25011+1461yrts5184000 [7] tmp 31 61 92 122 153 184 214 245 275 306 337 366 [8] z(, file [2] (nc 't')5 (0=nc 'ufiles')/1 if ufiles is defined, [3] uufiles 2 use it to decide which file to use [4] 1:uucmd ']ufile' else, [5] u(0,u[1;]']')u get search list from file [6] 2:tfopen(1u)u use first file in list [7] 5:hread t,2 file head [8] aread t,h[2] nread t,h[3] names matrix and numeric info [9] z(0,n[;1])[1+a matiota matrify f] name class [10] zz-2z=5 CHANGE CLASS 5 (LOCKED FNS IN PKG) TO 3 99=AA[^aZ zt objdata b;a;h;i;n;t;u;io [1] returns the tie number and component number of the value of object b [2] and create modify dates [3] if the object is not defined, the component number is zero [4] io1 (nc 't')0 t0 [5] 0:(t>0)/3 [6] (0=nc 'ufiles')/1 if ufiles is defined, [7] uufiles 2 use first file named in it [8] 1:uucmd ']ufile' else, [9] u(0,u[1;]']')u get search list from file [10] 2:tfopen(1u)u tie first file on list [11] 3:hread t,2 file head [12] aread t,h[2] nread t,h[3] names matrix and numeric info [13] hia matiota matrify b look up names [14] zt,hn[h/i; 2 3 4] tie number, component number, cr date, mod date [15] (~(1b)^1=i)/0 z,z return vector if arg was vector with one name = 0 0 0 ros a;io;apl;case;d;file;f;left;num;obj;o;pat;result;right;t;x [1] oBJECT sTRING cOMMAND aRGUMENT - USED BY cmd [2] tHE IDEA IS TO SPLIT SEARCH STRINGS FROM sWITCHES (/...) [3] sINCE THE TEXT TO SEARCH MAY CONTAIN BLANKS THE STRING [4] SHOULD BE SURROUNDED BY A PERTICULAR CHARACTER (LIKE QUOTE). [5] [6] tHUS, os 'ABC '''' ''TEXT + B/'' /l /x=c /o=mYfN' SHOULD RETURN [7] SOMETHING LIKE '*lc*ABC**TEXT + B/' AND SET cmdla TO 'mYfN'. iF A [8] FILE IS TO BE SEARCHED IT WILL BE TIED AND THE NUMBER PUT IN cmdla. [9] t'/apl/case/file=/left/num/obj=/result/right/x ;bctBCT/pat' [10] io1 d1at parse a [11] ER((oobj)^ffile)/'/file AND /obj ARE MUTUALLY EXCLUSIVE' [12] r(num,case,result,right,left,apl,pat)/'ni=rlap' [13] pat10 [14] u 'uload pkgmatch /sh /quiet' bring in pattern matching fns [15] 2 SHELL pkgmatch localize in [16] 10:(0tx)/20 rr,'bctbct ;'['BCTbct ;'t] [17] cHECK FOR FILE [18] 20:f40 (iferrin 'cmdlafopen file')80 gO FOR FILENAME [19] ER(iferrin 'cmdlafile')/'file error' OR TIE NUMBER [20] 80 [21] 30: [22] objcmdlaremshadowed obj 80 [23] 40:o50 (''1obj)60 (2obj1obj)80,30 [24] 50:objnl 3 30 [25] 60:(obj^.=' ')70,50 [26] 70:('>'1cmdlaobj)80 [27] 'cmdla' is returned globally [28] cmdlaobjt over u 'globals ',(t1obj),'/fun/full' [29] 80:rd,r,a 0=1  par parmspatn parse arg;d;e;dlm;i;p;pat;q;s;sp;sw;swit;t;D;;io [1] DAN bARONET 1993 - parse SWITCHES AND RESET ARGUMENT. VERSION 2.2 [2] SPACES ARE USED TO DELIMIT ARGUMENTS. '/' DELIMITS SWITCHES. [3] QUOTES CAN BE USED TO INCLUDE SPACES OR '/'. [4] SWITCHES CAN EXIST WITH OR WITHOUT [POSSIBLY DEFAULTED] VALUE [5] OR BE ELIDED. NON MENTIONNED SWITCHES ARE REFUSED. [6] SHORTER NAME ARE ACCEPTED BUT '=' must BE USED TO SUPPLY VALUES. [7] IN THE FUNCTION SWITCH VARIABLES HAVE THE SAME NAME PRECEDED BY '' [8] OR CONTENTS OF IMMEDIATLY GLOBAL ''. [9] EXAMPLE: [10] cmdarg '/sa /ab= /sc[=] /cd=1 2 3 /e[=]d e f /=*' parse cmdarg [11] [12] io1 t\''''=arg' ',arg s\swt1q t=1ST quote [43] pts> dELIMITERS: SPACES NOT IN QUOTES OR 1ST QUOTE [44] cOMPRESSOR: ANY DOUBLE QUOTE OR LAST QUOTE NOT IN \ OR DOUBLE DELIM. [45] parms[p/p]1D parms((1q)p^1p)/parms [46] dANb 1994/03/25 17:47 a 0=1 E utPARSE utility. Keywords: USER COMMANDS, ARGUMENTS, SWITCHES VERSION 1.0 This function will return the parsed arguments of a string argument to a USER COMMAND. It will also set a series of globals, one per allowable command switch. To understand what this means consider the following: - all user commands take an argument which is whatever was to the right after the command name; - all commands accept zero or more switches. An argument is whatever the commands applies to. A switch alters the behaviour of the command. Arguments are separated by spaces. Switches are preceded by a delimiter. They end at the beginning of the next switch or the end of the string. Switches may be absent, present and/or take a value. Example: ]MYCOMMAND 1ST-ARG 2ND-ARG MEBBE-3RD /SWITCH1 /SWITCH2=abc Here '1ST-ARG', '2ND-ARG' and 'MEBBE-3RD' are the arguments. 'SWITCH1' and 'SWITCH2' are switches which modify the behaviour of 'MYCOMMAND'. 'SWITCH1' is present and 'SWITCH2' is not only present but has the value abc. The function will return (in this case) the string '*1ST-ARG*2ND-ARG*MEBBE-3RD' and set the global variables 'SWITCH1' to 1 and 'SWITCH2' to 'abc'. The star character (*) is an example. In practice the function should return a delimiter which cannot be entered from the keyboard such as AV[255+IO]. Example: CMDMYCOMMAND ARG; SWITCH1; SWITCH2; SW3 ;SW4 ;DELIMITER [1] THIS COMMAND WILL SHOW THE ARGUMENTS AS PARSED BY [2] DELIMITER''ARG'/SWITCH1 /SWITCH2= /SW3 /SW4[=]' PARSE ARG [3] (+/DELIMITER=ARG),' ARGUMENTS ENTERED' [4] 'VALUE OF SWITCH1: ',SWITCH1 [5] 'VALUE OF SWITCH2: ',SWITCH2 [6] 'VALUE OF SW3: ',SW3 [7] 'VALUE OF SW4: ',SW4 This command will only accept 4 different switches: SWITCH1, SWITCH2, SW3 and SW4. SWITCH1 and SW3 can only appear WITHOUT any value assigned to them. If set, the variables SWITCH1 and SW3 will contain the value 1, if not, the value 0 (for each). SWITCH2 can only appear WITH a value assigned to it. If set it will contain the string assigned, otherwise the value 0. SW4 is ambiguous: if assigned without a value it is set to the numerical scalar one (1), if assigned (with the '=' character) it is set to the string next to it and if NOT present it is assigned the numerical scalar zero (0). The [=] meaning 'assignment not compulsory'. Problems with arguments arise when they must contain spaces or switch delimiters. These can be circumvented by using quotes around the arguments. PARSE will recognise empty strings and strings with quotes which must be doubled. Another hypothetical example: ]FNSEARCH LABEL 'MY CODE' 'I''M HERE/EH!' /S1 /S2 /ETC=... Limitations: - switches may not be the beginning of another switch, for example /SW and /SWITCH won't work - quotes are returned with switches. That is a minor inconvenience to allow switches to contain delimiters such as /SWITCH='/'. SWITCH will contain '/' (3 characters). - the first character of the argument MUST be a blank. This is usually no problem since the interpreter usually forwards the whole string which contains a blank as first character. Features: - the argument delimiter may be changed using the metaswitch /= as in '/MYSWITCH /2= /M1 /=*' PARSE ' a b '''' def' will return '*a*b**def' - the 1st character for the variables to contain the switch values may be changed if variable immediatly global '' is set to a perticular value Example: CMDX ARG; [1] 'X' ARG'/S=' PARSE ARG Global 'XS' contains switch [2] ... - the scope or range of values may be specified as in '/MYSWITCH=abc def gh ij' PARSE ARG where the value associated with the switch will be checked against 'abc def gh ij' to ensure it is a substring. NOTE this is ONLY a substring check. If the intent was to ensure any of the values to any of the 4 words there the check will fail as 'def gh' will be accepted. Final note: this is not a foolproof function. Its aim is to help saving time parsing the argument line. YOU must do your own checking from there. At least until ESP can be implemented... Dan Ba 0=2]S AR rm remshadowed f;io;b;d;g;n;s;t [1] detects names blocked by use of this fn and those that called it [2] and displays a warning message if any names are shadowed, and m1 [3] Returns valid names NOT in conflict [4] All we have to do is check if they appear either as locals or as [5] calling fns in the stack up to the 1st pending fn [6] This is typically used when nl 2 3 has to be checked against [7] known objects not originally there BEFORE the call [8] io1 (0=nc 'm')/'m1' [9] f(4nc f)fmatrify f [10] d0,b+/~\/'*'=n2 ws 2 nn[b;] [11] n(~n[;1]'')n get entries for functions on )SI [12] dd1n exclude global level, in case no UCMD [13] g0((+/^\1=t)tds5 ws f)[;1] good ones [14] r(gt/1s[;1b])f rem=not in ws & defined in stack [15] m0 bg^t [16] d,^\'['n n(n)d\d/,n [17] bb09D@@?C$ќ%@@@C$ќ%@@@B/̝ =@@AC$MngX@@AC$Mn@@B9@@BB/Ay\@@CC$Mna@@CB/̡,? =@@DB/u.ff@@DC$K;i@@EC$L@@EB1=\(@@FB/At(@@FC$K"+@@G9&YP#@@GC$K7C@@HC$kt@@HC$S/@@IC$6+@@I9S .@@J9Q;)@@J9Q;@@KB/G@@KC%w@@LB0k/ @@LB/;(@@MC$ @@MB/\o(@@NC%RkId@@NC$m~@@OB/MҮ@@O9Q;=@@PC%:ڿ+@@P@C$n,g@@PC%!cv@@PC%FS@@QC%B5@@Q@C$u€@@QB1'\8Q@@Q9ΐ!q@@RB/EN@@R@C$No<@@RC$ӚK$@@RC%р@@SC%5`͝@@S@C%B0r@@SB0yB#W\@@S9Ja3@@TC$ޘx o@@T@B08aG@@TC%?&Kc@@TC$c) @@UC$ϸ@@U@B/2@@UC%@.]@@UC%A[^@@V9؏\@@V@C$ߴO@@V9{@@VB06x@@WB0)p =@@W@B0#}j33@@WC$xᯀ@@WC$Mna@@XC$Mna@@X@C$MlB@@XC%KG@@XB/Hz@@Y9SeM33@@Y@C$Ԯ ǀ@@Y9Q;f@@Y9Q; @@ZB/v{@@Z@C$Ml`@@ZB0jz@@Z9D@@[B/iN@@[@C$6@@[C$Ml`@@[B/i괮@@\B/̡(@@\@9z.@@\C$l7΁@@\C%wn@@]9Q;H@@]@C$m/1@@]B/u+@@]C%w@@^C%w|@@^@9Q#@@^C%w|@@^C%w|@@_C%w7@@_@C$7 @@_9S\@@_9Q@@`B/@@` C%w7@@`@B0jp@@``B/药@@`C%RkId@@`C%wX@@`C%wX@@`C%wX@@aB/E`@@a C%w܀@@a@C%wq{@@a`C%w܀@@aC%w܀@@aB1']\@@aC%w܀@@aB09@@bC%w܀@@b B/+ݏ\@@b@C%w܀@@b`9zEQ@@bC%uE@@bB06xQ@@bB0)nǮ@@bB/R\)@@cC$n)w@@c C%!d@@c@B/G@@c`B0jW @@cC%w|@@cC$@@cC$覨R@@cB/SҮ@@d9ΐ Q@@d 9΍ˣ@@d@C$C@@d`C$F@@dB/p'@@dC%w3D@@dB/ff@@dC%q֟@@eB0cf@@e B0rxaG@@e@9Af@@e`B/\)@@e9@@eB0qʊ=@@eB/hZ㙚@@eB1 I@@fB/R@@f 9>J@@f@B/}m@@f`C$ޖԀ@@f9Ώ@@f9΍д33@@fC$x@@fC$ќS@@gB0(mB@@g C$ @@g@B/m{@@g`C$ֺ)o@@gB/<@@g9Q@@gB/1\@@gC%9Zf@@h9\@@h C%w\@@h@96H@@h`B/3@@h933@@h91@@h9΍7E33@@h9Ό@@iB/iz@@i C$E$@@i@C$jM@@i`C$=@@iC$ECB@@iC$ff@@iB0ȹG@@iC$ʹj@@jC$@@j C$Ea@@j@C$Ea@@j`C$jM@@jC$xᯀ@@jC$ҊPJC$2)/@@jC%wr@@jC$I;C$2)/@@kC$@@k B/G\@@k@C$C$2)/@@k`C%? 2@@kC%>xu@@kC$/@@kC$'À@@kB0e^=p@@lB/hB/h@@l 9t aH=ac lCLEARFILE COMPACK COMPAREFILES COMPBOOL COMPFN COMPIND COMPV COMPVAR DISPLAY FIT FNCR IDs InternLibs JDMR1 MCOMP PrimeList ProdLibs UNIQUE VM accessdoc addrdoc aligndoc asciidoc bmdoc callsdoc checklibdoc cmdaccess cmdaddr cmdalign cmdascii cmdbm cmdcalls cmdchecklib cmdcompare cmdcompfn cmdcompmat cmdcompufile cmddebug cmddfts cmddisplay cmddownload cmded cmdfactors cmdfdecode cmdfit cmdflib cmdfns cmdfori cmdfrdci cmdfread cmdglobals cmdhex cmdhistory cmdinputxt cmdkeepfnsof cmdlockedfns cmdlog cmdmonitor cmdnames cmdnoclash cmdobjects cmdohl cmdosr cmdoss cmdpackages cmdprtlines cmdrenum cmdsecurews cmdshow cmdsize cmdtag cmdtimefmt cmdtref cmdtws cmducheck cmdvars cmdversion cmdwhois cmdwsdrop cmdwslib cmdxref comparedoc compfndoc compmatdoc compufiledoc daysin debugdoc del dftsdoc displaydoc downloaddoc eddoc factorsof factorsdoc fdecodedoc fit fitdoc flibdoc fnsdoc fori foridoc frdcidoc freaddoc globalsdoc grpcmdaccess grpcmdaddr grpcmdcalls grpcmdchecklib grpcmdcompare grpcmdcompfn grpcmdcompmat grpcmdcompufilegrpcmddebug grpcmddfts grpcmddownload grpcmded grpcmdfactors grpcmdflib grpcmdfns grpcmdfrdci grpcmdglobals grpcmdmonitor grpcmdnames grpcmdobjects grpcmdohl grpcmdosr grpcmdoss grpcmdprtlines grpcmdrenum grpcmdsecurews grpcmdshow grpcmdtimefmt grpcmdtref grpcmducheck grpcmdvars grpcmdwhois grpcmdwsdrop grpcmdwslib hexdoc historydoc inputxtdoc isprime keepfnsofdoc lockedfnsdoc logdoc manymatch monitordoc namesdoc noclashdoc objectsdoc ohl ohldoc osr osrdoc oss ossdoc packagesdoc patmatch pkgcmdpunch pkgmatch pkgpcxfr pkgprtlines pkgstask prtlinesdoc punchdoc renumdoc securewsdoc showdoc sizedoc svm system tagdoc timefmt timefmtdoc timen to trap trefdoc tstofl twsdoc ucheckdoc varsdoc versiondoc where whoisdoc wsdropdoc wslibdoc xC1 xCOMPARE xDF xEQ xFT xFr xGENSYMB xMV xQZ xRD xTREEGEN xrefdoc addr allfns crfromvr default ftimerep nc objdata os parse parsedoc remshadowed shadowed wsnl = wsnY{]T\sG^4UVV7 c=` c=k dF (Hp((Xucmdps(@hkh(=!h(8X0 p   0 p (@hh8Z " ps48Presultt ucmd p;b;d;f;rc;globals;ufiles;ec;trapP8 imitate STSC's UCMD file system dFnA 8X(ppdef('io' pack 1) pins('ct' pack 2*46) pins 'pw' pack 79g X((globalsio,ct,pw ((X( (0nc 't')/'tMT'(T(io1 ( ( result 0 0 '' ((|( p(\~p' ]')/p ( ( (0=p)/0dFn( (h( case insensitive code(Pd(d[1 1 ;],dav[(av'aA').+0,25]), 2 12 '0123456789'P (b+/^\pd @ p[b]d[1;d[2;]bp] those 2 lines@@ cpt 4 in names fmt. Main file ALWAYS there.@@Bufiles(d)d(read t,4)names[numst;]@H1( on PC cpt 6 contains the binary code for unpackaging(H8d'rcf',,';',pnames bread t,58@rcfx>d'bppdef brct ucmd2 p'k@ xi((rc'f')1 ( (0=rcf)1 (F(ioglobals[io] ((ȍ( ctglobals[1+io] /f((( pwglobals[2+io] (( 0(o(1:signal(1=1rc)/1E((( (signal(4=1rc)/15ؽ<((P'UNEXPECTED ERROR WITHIN USER COMMAND PROCESSOR' signal 11P=_`(Px@h`(x0H((|a mp0((Nobal!0!(((0arms506((o' ':0; ((ȍs'=0=((vriB80B`(( DDD((EDE(((XrE@DE`(( les[Ex0E(([k[FX0Fx((  ouG0G((1(HX0Hx((0] I`0I(( es[J80JX((KX0K((ucmd2<(ble(@(] rchp=!v h 1i hi])/0 nrob8 n`  1(  l H / h fu ] ) ea  n[ 8 ,' X 8 x v '' ' ]) ck 0t Xv, ea n[ ,' rc  81: X' x( ,' '  w @e `We xea ag 50 o amP ifn is v,0eah,]  52,'8 X '3]  ` ,!('"v)"  "sP#,p$bu%os%0: &@'nu',(')b)'l@)in`* fx* + +c(,a@-ms-c.58/p H/(0si1d)2siH3d)3('4fi4 '@5rnX5d)x51 5F86 27r07va`8 D9ef:CT(;r H;F h< = ad ] h? (!ps4d0T8t4X$] P(dx ucmd2 p;ct;io;pw;a;c;e;errmsg;f;h;i;j;k;l;n;pkg;q;rc;s;t;tied;ttype;b;v;varc;w;y;z;ec;trap;m (X(pwglobals[2+io1] (( L( ctglobals[2](`]  varc'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQSRTUVWXYZ'matio`  T(ttype'apl' n( K( tiednums 8xt''x main UCMD file tie number8((q1s'/quiet'p (0p6( p[q/(s1)+1+6]' ':'0(^(m1s'/brk'p (HxD((0( p[m/(s1)+1+4]' ',';',p0 ](yread x,2 (^( zread x,y[2] (8  wread x,y[3] DIRNAMESCPTf pkg88,,;iz matiota matrify 'ec trap out'e8 Xk((i[1]=0)/2 ( 07( ecread x,w[i[1];2]0(K(2:(i[2]=0)/3 (0>( trapread x,w[i[2];2]????0 (w(3:q4  (0( d3 fd 'a out b' ( PS( e'out' ^( (~ed)/23 H;( 50L(4:(i[3]=0)/5 CUSTOM out00HJ(d3 fd read x,w[i[3];2] 0 p( e'out' & Ȝ( (~ed)/23 (P](5:p(\p' ')/p xD(((o( ('?'1p)/6 ((( p'uhelp ',1p5ؽ<(((ȍ(6:c(^\pvarc)/p (( pT( p(c)p 0pS((~('?'p)^^/p' ?')/7w(0S(pc  T( c'uhelp' S(7:it0 0N( kufiles matiota ufiles00J(8:((1ufiles)1(b'pkg'3j)(jl[i;],'')'pdef' (HP: SAX won't behave like SAM. We have to read the package twice:PXhc( once to read its name and once inside the fn to define its contentsgX@23 vv,'',j,'read ',dt,n[k[i];2] .. fi@(( b18 variable(89hh,(,';',pnames read d)~' ' rea8 18z  hj(22:s'' @ <( 0( m30  (( s'scmd',c,'1' '((p( ('A'165av)30(H"(s1'''1 stop ''cmd',c for debugging purposesxE(H0xL(30:b(~numst,tied)/nums 08ri vv,s,(0. Return code ',d) signal 11esPo] A((  vdefault(hHH6769 (=!925 0 00 `676767673 (63(X (!\1' '((p(rr default value(P DanB 1992 default CHARACTER STRING r BY value IF IT 02mdP0x ((r1)0 also a valid valueC(0  ((r0)mod dFn ( rvalue  5( 0Hm(mod: r IS not SCALAR 0 - IF value IS NUMERICnE(H(((' '=10value)/0 07 ( Э( rfi r  2 3h(X'/quparsep (D MENTS7=! SpUSMI S.pIT. TEHSEDE '8 SX N  O [P FA0 UEH R h N NE A . 8OR `RE BU  B SU S.  T pN IA TH E HY x S TL ' XA  8/s [= 3  /  c  Plm ' ar ad GOH p\ sg= HE nbH ot!l(" "w("H"pp#p$),%(~(&wip&q'5]'t)'[0(~()')@*+[1+ F+ S+O 8,EN`-TE./.0 (/n)`pah0 (V H?&$%D,DFnhX(parmspatn parse arg;d;e;dlm;i;p;pat;q;s;sp;sw;swit;t;D;;io;Er23)XXa( DAN BARONET 1993 - parse SWITCHES AND RESET ARGUMENT. VERSION L2.22gXP a SPACES ARE USED TO DELIMIT ARGUMENTS. '/' DELIMITS SWITCHES./P@H( QUOTES CAN BE USED TO INCLUDE SPACES OR '/'.@PG O SWITCHES CAN EXIST WITH OR WITHOUT [POSSIBLY DEFAULTED] VALUEPHd( OR BE ELIDED. NON MENTIONNED SWITCHES ARE REFUSED.E(HX( SHORTER NAME ARE ACCEPTED BUT '=' must BE USED TO SUPPLY VALUES.g XXH( IN THE FUNCTION SWITCH VARIABLES HAVE THE SAME NAME PRECEDED BY ''X@4( OR CONTENTS OF IMMEDIATLY GLOBAL ''.<(@ ( EXAMPLE:@dFn Xr( cmdarg '/sa /ab= /sc[=] /cd=1 2 3 /e[=]d e f /=*' parse cmdargthe X5(Er711 (p( dlm1patn,'/' (@H( arg' ',arg DanB: added for LOGOS use .. fi@@ (io1  6( t\arg='''' 83( s\swt( i1sp P6( siswit  |( switiswit @(pat'unknown or ambiguous switch: ',1td s u@0(pat signal(1+/itpatn)Er0(|(pat1(\i)/patn ltB((0( qd pat(1+patdlm)pat 2md0 x5( sp1sp0)/0 P CE pat IS ONE SWITCH DESCRIPTION FROM THE patTERnS ARGUMENT THERP(h(e''2(q)pat ode( ( ecm (F( pat[pat'']'='t ( (cm:t1 0( (/p2'[=]'pat)mem 0(ȍ( ('='s1s)l3,chk/f(((mem:(/ppat'=')/comp(P [8('no value allowed for switch ',pat) signal('='s)Er pt\iP( l3maP Dcomp:('value required for switch ',s) signal('='s)ErRGUMENTP(o(chk:t(is'=')s p (( 0( s[i]' ' b (P]( (' '^.=t)/comp 5ؽ<((08m( (' '^.=pat(p1)pat)/l3ueC(0@M(p(e^^/tpat)e1q t=1ST quote(Hp(pts> DELIMITERS: SPACES NOT IN QUOTES OR 1ST QUOTEHX ( COMPRESSOR: ANY DOUBLE QUOTE OR LAST QUOTE NOT IN \ OR DOUBLE DELIM.X((parms[p/p]1D (8( parms((1q)p^1p)/parms20d t806( DANB 1994/03/25 17:47x)/9 0[io(KU)fopen"(lt)s(=!  )HhtghsftP257]avt ct(s h x [ [s e]X )/se0 (U)& "\0(^(zl fopen f;i;a;b;d(P( TIES FILE (IF NOT ALREADY TIED) AND RETURNS THE TIE NUMBERP8H4(ppdef 'l' pack 0 default Lock 0nt8H((2=vi f,f)/1 iF NO LIBRARY NUMBER WAS PROVIDED,E(H83(d1ai GET DEFAULT DRIVE NUMBERrea883(f(0d),' ',f USE THE DEFAULT DRIVE8 h^(1:anames Fn @M( a(+/^\a=' ')a LEFT JUSTIFY FILE NAMES/03/25@ XL(f' ',f @ @C( bf' '  @( f1(b1b,0)/f DELETE EXCESS BLANKS FROM f@@H(i(a^.=(1a)f)1 SEARCH FOR THE FILE NAMEt @8((i>1a)/2 iF THE NAME WAS FOUND,ES8@4(znums[i] JUST RETURN ITS TIE NUMBERs u@8(0 eLSE, THE FILE IS NOT YET TIED,~t8P2:z((nums)nums)0 LOWEST AVAILABLE TIE NUMBERCHES./P0(f stie z,l TIE THE FILEi-10a,[(P]'''matrifyxD(((?ts [(=!T EDRN NU  ef0 8/1 (0 (\(((rd matrify r;t(Hp( FORMS A MATRIX FROM A VECTOR OR MATRIX OF NAMES xE(H`/a OPTIONAL LEFT ARGUMENT IS A LIST OF DELIMITER CHARACTERS (DEFAULT=' ')io+fi` X((2r)0 dFn (^( (nc 'd')l10 n;d(( d' 'Xk(l10:(0r>2<(t1trd)/rr,d)0 only 1 del between wordsXXH(r 0 0 '' Sharp APL enclosed array system cannot handle empty cases(XTIE (matiota&(@   ((=!4]rP1,d 18enx ' L rrca@ e h s  F8 5 ind0p ( &OR0PR0 indexleft matiota right;sl;sr;grade;rows;select;iota;i;io)/aPXr( returns the locations of the rows of right within left for char mats(XH( left and right need not match in width. Not found=0HHp( much more efficient than ^.= for large matricesxE(H@(i0,1(slleftleft)srrightright0x @((left(isl)left ((( right(isr)right ( Hx( rows1sr@dFn 0x(leftleftav[256]io1 r0((gradeavrightleft((^(selectgraderows((0(indexiotarowsifyote(XH(index[select/grade]((~select)/grade)[1+(select/select)-iota]-rowsX8(index[(/rightleft[index;])/iota]0nS8er @(radeiferrin(X88????(=!(x c x (s (^(1iferrin 2;trap(Xk( RETURNS 1 IF AN ERROR OCCURS WHILE EXECUTING STATEMENT , 0 IF NOTXP r GLOBAL RESULT errmsg IS THE FIRST LINE OF THE ERROR MESSAGE PH( (errmsg IS NOT CHANGED IF THERE IS NO ERROR)E(H0(trap'c errmsger 0'[1] 0(11  ( 2 @( 10mX BCR<( (  @LF;( 8  rBS<( @  EX c<(@(=!<(`@RIlu [@ @ ( " `+(ra EX b@dFn +(r(~ab)/a 0)%"CRL ;hH(=!uepHnBulR H( (%"( r(rCRL f;s;bdFn )(s\bf'[]' 83( r,(cr(~s)/f)[io+fi(s>b)/f;]k dFnS80  DR 8g @(=! `@trx] A M@  * ( (rDR x 6(r82+81010x R CH ER ~h(H(=!] hH/(xnoH  (F x((ER msg ((0msg)0 Fn (( msg signal 111ER( En  SS 8k V1@=!`@@ ` ( " 0)(ra SS b@dFn (rba out 8y F8 H(=! rhHt  dH % (  (out aH0((fUNCTION THROUGH WHICH ALL OUTPUT IS PASSED; E(H(aC [5(^over(Ak(=!(Px # (  % ('(AzAa over Ab;s(0.( fORMS A MATRIX WITH OVER 0((Aa(2 1 1 ,Aa)Aa ((Xr( Ab(2 1 1 ,Ab)Ab(((s 0 1 (Aa)Ab ( $( Aa(sAa)Aa !( Ab(sAb)Ab ж( AzAa,[io] Ab file=@ (H@Hh( Xu @(@ in(=!el@thp(lH 'xif,(8mP   k)  (x in ma ',)8 ($$s%h0] 80F(ru c;trap;f;t;ucmd;MT(0P simulate user command processor - can be erased from wsm30PPara This fn is brought in the ws the 1st time a user cmd is usedaP8((c(\~c' ]')/c)0r 0 0 0Fn/80HG(f(10 0 1ai),12' ucmds' [0(H( trap'22 o e 30'(0F( 1st try with local UCMD file08@(10:(t(names^.=f)/nums)50(80F(f stie t1+/1000,nums (0И( 50@p&( that didn't work, use general UCMD filemd;MT@H&(30:trap'22 o e ''ucmd file not found'' signal 22'(H0 (f' 2970082 ucmds ' 0 ( 10Xk(50:'invalid boot fn' signal('ucmd',pnames fread t,3)11&<($<(X8x( MT is the Main ucmd file Tie #8x)/8'(MTt  x ( fppdef f ( 6( rt ucmd c fine(