TE006143*nTTv4YZa   EHIJKTTYPEVVARCSUERRMSGQPKGTIEDYZWr23512111314221617182119VALUEMODaZaAaBZFPARMSPATNARGEDLMPATQSPSWSWITdL0L5CMMEML3CHKCOMPL4nCsR12aLlrEphIdsRh9806734DeFtnCTRTDSiLPKL1L2BwosrhowosshowRESULTDFOVERIFERRINOUTXALN101520AV2545CMDOSSOSCMDOSROSSOSRL15L10pOvL11L17L20L30L35L40L50MvFiLLuPVaRNeXFrPMCmznsl30354050pPARSEOBJFILELEFTRIGHTAPLpUTEST1BCDEFTESTLAANDDOESNHOSEDLBTRYTHISWITHLCTEST2TEST3eWWWWWBVCXXYZcUp7560705565CASEnC2767TIEONUMVAROSSDOCOSRDOCXTSCMDLA GRPCMDOSSNUMFNVANNAAGPATIOTA FTIMEBASEDEBOBJDEB RJUSTOBJRJUST LJUSTOBJLJUST CMDUNAMESUADDRCMDADDRaTaWUDRURUMUHDUFGR TELPRINTOBJ TELPRINT SHADOWEDTIEUFCMDULOAD GRPCMDOSR MATIOTAOBJ MATRIFYOBJ OVEROBJFOPENMATIOTAMATRIFYDEFAULTUCMD2SYSIDUFILES GLOBALPW GLOBALIO GLOBALCT GLOBALELX GLOBALALXPNAMESPDEFPACKBINRCBPUCMDEDITWINHLcVVLVVT ^G? OSR : Object Search and Replace --- This function will scan the function names passed as left argument and effectuate replacements according to right argument. Syntax: [NL] OSR '/[HOW]/S1/R1/S2/R2...' NL is optional name list (table or space delimited list of names), / is a delimiter not to appear in the search, S1, S2 are the search strings, R1, R2 are the replacement strings and HOW is a replacement method. If the name list is not supplied the function will scan all functions in the ws. 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. The function uses local names which may clash with the names to search (see the function header) and will operate more or less fast depending on the type of search in effect. HOW is the search method: to specify the type of search to use, simply flag the requested search between the two first delimiters in the right argument as follow: B DO NOT search the body of the function (the APL statements) T DO NOT search the text between quotes C DO NOT search the comments L left syntaxic search R right syntaxic search A enforce APL rules for text and body I ignore case For example: OSR '//abc/xyz' replace 'abc' by 'xyz' everywhere OSR '/r/abc/Q107' replace all 'abc' right ending strings by 'Q107' (only abc being replaced by Q107 of course). OSR '/l/abc/Q107' same but for left starting strings OSR '*lr*abc*Q107' same but for both left and right strings, in other words for the exact element 'abc' with no number, , , alphabet or around it. OSR ';c;abc;Z99' replace abc by Z99 everywhere except in the comments 'fn1 test' OSR '!bc!Sharp!Reuters' replace all occurences of Sharp by Reuters in the quoted text only (not the body or comments) in functions 'fn1' and 'test' 'Fw' OSR '/lr/x/y/y/x' swap all occurences of 'x' and 'y' names in function 'Fw'. OSR '/ATC/z/y/y/z' swap 'z' and 'y' in APL body only including text between and . Restrictions & 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' as replacement method slows down the program dramatically. Shape of variables invariably changes as the length of replacement strings differ from their originals. Using /BCTA/ only makes sense for functions or variables holding CR (VR) of functions. Note that in the latter case the line numbering is also subject to replacement. Dan Baronet, 1988xX $^G? OSS : Object Search String --- This function will scan the function names passed as left argument and show occurences found according to right argument. Syntax: [NL] OSS '/[HOW]/S1/S2/...' NL is optional name list (table or space delimited list of names), / is a delimiter not to appear in the search, S1, S2 are the search strings, and HOW is a replacement method. If the name list is not supplied the function will scan all functions in the ws. 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. The function uses local names which may clash with the names to search (see the function header) and will operate more or less fast depending on the type of search in effect. HOW: the search method. To specify the type of search to use, simply flag the requested search between the two first delimiters in the right argument using the letter as follows: b DO NOT search the Body of the function (the APL statements) t DO NOT search the Text between quotes c DO NOT search the Comments l Left syntaxic search r Right syntaxic search a enforce APL rules for text and body i ignore case  will return the number of occurences instead of displaying the lines with carets (^) under each occurence ; DO NOT search objects where string appears in first line DO NOT search objects where string does NOT appear in 1st line For example: OSS '//abc' show all occurences of abc everywhere in all functions in the ws OSS '/r/abc' show all 'abc' right ending strings. OSS '/l/abc' same but for left starting strings OSS '*lr*abc' same but for both left and right strings, in other words for the exact element 'abc' with no number, , , alphabet or around it. OSS ';c;abc' show 'abc' everywhere except in the comments 'fn1 test' OSS '!bc !Sharp' show all occurences of Sharp in the quoted text only in the functions 'fn1' and 'test' 'Fw' OSS '/alr/x/y' show all occurences of 'x' and 'y' names in function 'Fw' even in strings and the like. fns OSS '/LR;cta/X' find where 'X' appears as a global reference in 'fns' 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. Use of 'A' in search method slows down the program dramatically. Quotes cannot be searched for properly in this version. When searching for quotes, remember to double them when looking in text and not when looking in comments... Also, edge conditions may produce unpredictable results ! Dan Baronet, 1991 :tU``G?zU  >; A; C; D;; G; ?; @; H; I; F; E; ; ; ; \; ; ; ; ; ; ZzUPtU U00010000# DanB 86..95 - Object Search String - Version 4.5UPzU U00020000 I#~ sR aLl hId sRh OSS pO Mv Up LU0U U00030000.(7OSS)/  UPU U00040000# OSS could be TIE #, start, last cpts, incrementUU U00050000 :.(   ? )  H @ ? ?(  ?) @( ?)U`U U00060000 H[] ?[] @[]  H[ ]  H[]. UPU U00070000 : ( ?" ?   )/   U@U U00080000 :# set variables from argumentsUPU U00090000 G( E/  E >  >) ># mode, stringsU`U U00100000# ~Body, ~Text, ~, Apl, L/R syntaxic, RESULT, no lcal;global(),U@U U00110000# case Insensitive, search NumericU`U U00120000 Z @  btcalr=;inBTCALRIN  G[] >UpU U00130000  H[?] @[ ]/BTC# ...perticular constraintsUU U00140000 ( @[]) .( >( ? ?)/ ? G[] >)# all strings togetherUU U00150000 ?( G)  G ?   ? ?  ? G# start of each str (0), length (1)U`U U00160000 A4ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#UPU U00170000 A A0123456789_# Special charactersUPU U00180000# Build locals functionsU0U U00190000# The VTOM fnU`U U00200000 EDIO1L1L-1+1L(~B)/BDMV,D1VM(B)(,BL./0,BL)\B/MU`U U00210000.( 7MATRIFY)  EMV[0]MATRIFY V# UCMD fn available?UPU U00220000 : EA(( E)MMv V;D;L;IO)[] E#U@U U00230000. @[ ] &# The UPPERCASE fnUPU U00240000  A EBB/BR[B]L[0;L[1;]R[B]]UPU V00250000 EA RUp R;B(/BRL[1;])0 E#V@U V00260000 > ># search uppercase version?V0V V00270000# The \ Partitionning fnVPV V00280000 &: EA %rs pO p;tsspr\s\t10,ts/p# VPV V00290000# mask fn: Comments, Text, Body, Diamonds, AplVP V V00300000 E"BCTT>C\(M'')>TT\TM''''# non APL textV`V V00310000. @[] ' E EBCTT>(M)(,1,0 1B^M'')# APL textV`V #V00320000 E E3pO(ASS'ELX')(ASS'ALX')(ASS'NC')''=A,M##VPV (V00330000# NOTE: {error:trapping} NOT taken in account(V`#V .V00340000 ': EA MhId M;C;T;B;A( / EM~ H)(0 )/M1#.V@(V 2V00350000# search fn - arg is rank 22V`.V 8V00360000 E9RsRh T;H;M;S;N;s;I;W;ELX(0ST)RI0MhId TN1#8V`2V >V00370000 E EELX'(33T),TCNL,DM0' F/ @[]# L/R>Vp8V EV00380000 E E( F/ s1~TaLl)T( @[ ]/Up),T I/ @[]#EVp>V LV00390000 E EL:WsR[0[I]+1[I]]RR I/((0 @[]) ~1S[1]H)^H#LV`EV RV00400000 E E (ST SS W)( @[]/^s)( @[]/ ^(1+1[I])s)#RV@LV VV00410000 EA  E (N>II+1)/L /RR^MVV RV XV00420000. / XV`VV ^V00430000 (:.(  ) I.(  7 F(   ) )/  H F^V0XV aV00440000# Search and countaV`^V gV00450000 :.( @/ E D H)  I/ E @ EgV0aV jV00460000# Display if any foundjV`gV pV00470000.( )/  \(  Var )[ ;] F.  )pVPjV uV00480000 \( ):(   \  ) \ H[;]uV`pV {V00490000 ): \ (( I) found) \ /\ / H @ H{V0uV ~V00500000# Lines found displayed here~VP{V V00510000 :( P<[>Q<]>I5,X1 @ ) \[] H[;]V@~V V00520000 ( \[] E[;])\^VpV V00530000.(  E E)/  H H @[ @ ] \ \. V V V00540000# VariablesV0V V00550000 : H- F# char mat onlyV`V V00560000 :.( Z E   H) .( Z. E)  H HV`V V00570000 :.(   H)/  H  H. # ensure matrix for searchV0V V00580000# Get next item to searchV`V V00590000 :   I. /  ( F) . (# object or file V`V 00600000 :.(/   )  H .  F iV``G?V = >; P; A; C; B; D;; G; ?; @; H; I; F; E; ; ; ; Z; ; ; Z; ; VPV V00010000# DanB 86..95 - Object Search and Replace - Version 4.5V@V V00020000#~ sR aLl hId sRh OSR pO Mv pUV0V V00030000.(7OSR)/  VPV V00040000# OSR could be TIE #, start, last cpts, incrementVV V00050000 :.(   ? )  H @ ? ?(  ?) @( ?)V`V V00060000 H[] ?[] @[]  H[ ]  H[]. VPV V00070000 : ( ?" ?   )/   V@V V00080000 :# set variables from argumentsVpV V00090000 =ARG LENGTH ERROR.( G( F/  F >  >) >)/ =V`V V00100000# ~Body, ~Text, ~, Apl, L/R syntaxic, RESULT, no lcal;global(),VPV V00110000# case Insensitive, search Numeric (not implemented yet)V`V V00120000 Z @  btcalr=;inBTCALRIN  G[] >V`V V00130000 A4ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#VPV V00140000 A A0123456789_# Special charactersV V W00150000W@V W00160000# Build locals functionsW0W W00170000# The Partitionning fnsWpW W00180000 EA(( E) rs pO p;t)[] Esspr\s\t10,ts/p#WpW W00190000 EA(( E) rs pU p;t)[] Er\ps\t10,ts/\10,p#W0W W00200000# The MAT from StringW`W W00210000 EDIO1L1L-1+1L(~D)/DDMV,D1VM(D)(,DL./0,DL)\D/MW`W %W00220000.( 7MATRIFY)  EMV[0] MATRIFY V# UCMD fn available?%WPW *W00230000 : EA(( E)MMv V;D;L;IO)[] E#*W@%W .W00240000. @[ ] &# The UPPERCASE fn.WP*W 3W00250000  A EBB/BR[B]L[0;L[1;]R[B]]3WP.W 8W00260000 EA RUp R;B(/BRL[1;])0 E#8W@3W [ H] >[ H]# repl all cases versionsBW ( ? ?)/ ? G[] >)# all strings togetherQWKW YW00320000 ?( G)  G ?   ? ?  ? G# start of each str (0), length (1)YWPQW ^W00330000# Mask fn: Comments, Text, Body, Diamonds, Apl^W`YW dW00340000 E*BCTT>CL pO(M'')>TTL pU TM''''# ~APL textdW0^W gW00350000. @[] 'gW`dW mW00360000 E E3A(ASS'ELX')(ASS'ALX')(ASS'NC')''=A,M#mWPgW rW00370000 E EBCTT>(LB^M'')pO A# APL textrWPmW wW00380000# NOTE: {error:trapping} NOT taken into accountwW`rW }W00390000 ': F:RV hId M;L;C;T;B;AR1LM=TCNLV/2RR HW }W W00410000W0W W00420000# Search fnWpW W00430000 F(/ @[])/ s1~taLl I( @[]/^s) @[]/ ^(1+1[i])s#LRWpW W00440000 E0rV sRh t;m;S;z;n;s;ir0 2i0n1mV hId t( @[ ]/Up t) F#WPW W00450000 F/ @[] E E F/S11S/St=1t#WPW W00460000 E E!l:zm^(tSS sR[0[2i]+1[i]]) I#W`W W00470000 E E( F/( @[] ~/Sz)e)rr,[0](z/z),[.1]i#W@W W00480000 E Ee:(n>ii+z1)/lrr[r;]#W`W W00490000 IA  E/L:(^/s\z10,1[r[;1]]+zr[;0])/0rsrL#W0W W00500000# Replacing fnW W W00510000 EL22[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]#WPW W00520000 IA(( E)TP rEp T;K;L1;L2;B;w)[ɿ] E#W W W00530000#WpW W00540000 @(? ?) ? ? @[;] @ @[;]# 0:start; 1,2:lenW W W00550000. / W`W W00560000 :.( ).(  7 F(   ) )/  P FW0W W00570000# Search and ReplaceWPW W00580000 :.( I E  D P P)/ W`W W00590000# Replace in environment. Search performed on vectors, vector resultWPW W00600000 P E B P. / # TCNL used to matrify - BEWARE!W`W W00610000 = = I E  P. E/ Not  F. WpW W00620000 : . H P  P. /  E P(( H) E) E  PWpW W00630000.(..  H E) .(  /( H(  H)) P)  P  PW@W W00640000 : = = I. / - FDeF. W0W X00650000 : P . / ) X W X00660000# VariablesX0X X00670000 : P- F# character only. X@X X00680000 :.(   P)  H P. 0 X0X X00690000# Get next item to search XP X X00700000 :. /  ( F) . # object or file  +XP X 00710000 :.(/   )/ P .  X^G?osrhowX!^G?osshowX^G?RESULTX^G?OVERX_G?IFERRINX_G?OUTX`G?CMDOSS X`G?CMDOSRX bG?PARSES XbG?OBJ !XbG?FILE "XbG?LEFTNUM #XbG?RIGHTSEN$XbG?APLRPCMD%X3dG?TEST1 &XEdG?TEST'XWdG?DOESN(X]dG?HOSED)XodG?THIS*XudG?WITH+XdG?TEST2,XdG?TEST3-XdG?BVCXXYZ.XdG?CASE /XeG?TIE0XGeG?CMDLA1XMeG?GRPCMDOSS2XSeG?NUM@@^l3XfG?EDIT4XfG?UCMD5XCfG?SYSID6XIfG?UFILES7XOfG?GLOBALPW8XUfG?GLOBALIO9X[fG?GLOBALCT:X afG?GLOBALELXXmfG?PNAMES?XsfG?PDEF@XyfG?PACKBINAX fG?MATIOTAOBJUVWXYZCX fG?MATRIFYOBJefghijEXfG?OVEROBJFX%fG?FOPENzGX+fG?MATIOTAHX1fG?MATRIFYIX7fG?DEFAULTJX=fG?UCMD2KXZG?TTYPELXZG?VARCMX[G?ERRMSGNX[G?PKGOX[G?TIEDPX{[G?VALUEQX[G?PARMSRX[G?PATNSX[G?SWITTX\G?COMPUX`\G?KFILE NOT FOUND IFERRIN[5] TFOPEN UFILES[I;] ^[X fG?GRPCMDOSR\X eG?TELPRINTOBJ uniqu^XeG?TELPRINT_XeG?SHADOWED`XfG?TIEUF aXfG?CMDULOAD bXeG?UDR cXeG?URUMDOC dXeG?UHDDEFDeXeG?ADDRfXeG?CMDADDR}SgXweG?PATIOTALhX }eG?FTIMEBASENUMS~TIEDNUNjXeG?DEBOBJDkXeG?DEB10000lX eG?RJUSTOBJ A;CMDULOAD nXeG?RJUST oX eG?LJUSTOBJ ;SHADOWED qXeG?LJUSTT rXeG?CMDUNAMESsX5eG?OSRDOCtX/eG?OSSDOCuX)eG?NUMVARvXZG?wXXG?$ ASWSSEARCHa    SYSHELP