# 8> ,~G~ xڎ ~4~ ~ʕvIh%<= |A i3X35150832#`aqYIOf2d;1LTOC,ew<~To*  f  !"#$%&'()*+,w\~&w 8-e./501|\23456789:;w<=>?@ABCDrW$wEFGHIJKLMNOU@:.67nolm`S6 38/=(83Ɣ4Ĕ6\;\>ɔeg9:hu@D_4HFFtF@@@t@EK~P &QDjq7єxl,SS "PQTRZJJ|\|\(s|uQgjk j(jljDjDjPQkR j(jDjDjƔTE N )   !!"#%%&'(b)  de  0  ori  00  w24: rwssize,wsowner,wsts v0D This fn emulates SHARP APL's ws system functionpDSINw683w5w4w3nro( 00ent rval not good is shared1/20)/ 3  ti 0wn[ ] [1] 0dec,NGOtHMMXL`MDLK N N L L OMLL8MLLMMMDH0HHpKOHGLlOItIPKN`ILIdNII w5: nameclass (Dw3: members of groups((w24\Cw1: namelists: val is the sum of 1=fn, 2=var, 4=grp, 8=label, 16=binds\<w4: storage (works on sys vars in SAPL)r'<B 4B error(~(,1)1/n)/'domain error'd4DB 0 XBw21: rwsid xB0 |Iw22: rsi ' B .0 Some fns cannot be reproduced0B 0tC 04C (1 2 3 4 5 6=n)/w1,w2,w3,w4,w5,w64 04Gw23: r(61),symb,(1ai),0 0 0 4A0PAS (n=1 2 3 4)/w21,w22,w23,w24 0D ridlist val objects in this fn will be shownD(4Nw6: value of variable( $B rn WS valt $I r0 1idloc val l$8 error(~(,1)1/val)/'length error'edl8t Uw23l1:w22Sw21ARSw2'w1 = rsize val TvalWSN DanB 2002O r0 0'' ,t6w2: misc ws description,T  jj  T R1/VALUE D(R0)MOD  /Q UVXrZR[ !%&*  !"%%%&'()*+,../0123456789:;<=??@ABCGGGGHIJKMMNPPparse, DanB 1994/03/25 17:47,4" PARMS((1Q)P^1P)/PARMS]4$PARMS[P/P]1d $X Compressor: any double quote or last quote not in \ or double delim.XHchcPTS> Delimiters: spaces not in quotes or 1st quoteH( TQ>1Q T=1st QUOTE(l1: IQ^1Q l $ \QPARMS'''' $ L5:SPARMS' ' @ c0 The following allows to consider '' properlyc@P3  Delimit each token in the argument and return them delimitedP L200 ,Q,'',(I/'1(\S)/'),'T' a 0$DL4:I/S''''=T 0$,,1 T(-SS)T$DL3:(/S' '=T)L4 $DĄ Drop trailing spaces, remove surrounding quotesD@IERROR P/'INVALID VALUE FOR SWITCH ',(I-1)S@@p,bP(E^^/TPAT)E 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 TCDEL. 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 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 Baronet, Feb 1993,SPARSEDOCev`xdP4l@0  D8!l$lT<  D*,,)t`H0   H4A  %=EFT:@,"p\08 8$8H $_l&pW TS\pT2YDD+h$GtaIlJKXL4HNOϕvyT\bh\(p-h@(;T>hx||3$LB7`hm0'Dd#pC~tX$XfPR5ZePt?6|Hx4[4o8n\XzjTtDw0.<M<Lh$@|8uXU g4it^Q`pdɕH48xLPdr  1 {9P $`\H40XD0/ s(lX 0.D!cp3D$]  0͕͕̕ ͕̕0͕h͕/L͕͕͕d̕0̕lTʕ9̕7̕̕P̕hʕE̕2ʕʕlʕ˕Jʕ`t̕K͕̕*0\% •1쏕؏:ďV+|d48Lb8$R,;fܫ^<|dLPl<(hxqO@kxÕx`0Le8M$=|g& 'tI`}L<8r$modwPh>df`Pf|fgTR^SXabOIOXODOL0OvO-OKHGHHZHa$7aas (C( 8(D4(9nas(P7(n_N_R_[Ppdef%cnPsel(PvalD`O  $  ` ,as EPnames p (h,as 0Pnc N[0;] Psel p r(0tas EPnames 'xx' Pex Pack 'xx'0  as EPnames p  bn[0;]$@ as EPnames p3 $dkas vn'vn'Pval p˓$ ,rtestvr vc ($\(1r_2=n_[;1+io])0 (H =HXX DanB simulate packages. Format is 'ID' (table of name,class,values)\X((2 1p)0 21 array( rcn Psel p;io L (r_(n_[;1+io]3 4)/n_[;2+io])22 then fns & opslL(as rtest'test' Pval p((as (,0) ' xx' Pnc pnt($/ r_ncn_[;io] $tl ֨+4엕бL\Ht0 !r_v_ Pack n_;id_;c_;b_;N_;O_0 ػokPchk p;iot : nxbyz{at 0 #rabstn  !",$as 'tmp',Pnames b Pex pse, l20,N1 0N ('(('Package')0,p)0d($rnames Pnc p;cl $0о ('(r_ ',,n_[;io]),')r_'tl0  nN[0;] Pval p T ep'error(~t)/''oops!''',0fx'rcut b' 'r1(b1b)penclose b'T ֨+䶕쨕\4 좕$ 04opnl Plock op;np;io;fns;i;b0  r_''=,1N_ 4 v_[r_]b_/v_ L$  v$thL$rn Pval p;io;b$/ ֨+8H<н̡Xȭذ0vcfx'ra pick b' 'rab' 0$| r(1,p)[;0]cn$<: N_1r_ penclose N_ )envlevel 2 only< ֨+(\@<PD4ÕpȞ`4P error (~Pchk n_)/'domain error'4x4 ֨+蟕dÕd8Lx D H l ا ตlВಕ48h\Px0о r_2 1id_(1 3(v_~' ') 2 n_) 0<: is set the following before calling it:<, ֨+@8ĥ4   t  줕 ̶Р 䭕\ ( D |!"䳕#$%8&&@'()p*|+Ȑ+,-䕕.,,04 danb 1999 ppdef a la Sharp0w bnl $, r_0N_n_[;io] $$ r~(1,p)[;0]cn$  np[i;2] fns0 |r0 0'' (؛ ANY string will do ($% (82dr cn)4 $ <clrp[;1+io] l10,n1 0ne  1(2>p)06 b_4  | (nc'N_')12 ķ then the vars $4(pcn Pex p;io ;rg$(iook0p( r2 11 r repl[0],p(/ nl1nls:$as eppPack ' ' $ as eppPack '' $* r_2 1id, n_o_$0: fns(inp[;0]1nl)np[;2] 0 ȣ (Pchk x)0f $0 c_' '=n_c_/n_ed$$- 10,' notr'L $ X(R_N_ Pdef n_1 4Ⱥ n(\' 'n)/n(-bb' '=n)n,nef4,P vcfx'rdis x' 'rx',<2l30:", danb 1999 merge packages, )io05op[1;0] np$` r_exn_[;io]$$ v_[r_]VR v_[r_]$ .(0nc 'N_')9 80 and call it:  r_0 3''44ok311,p 3 col matrix4Hio0 <rPisID idD(r_b_/b_c_3 4 9)20 fns, ops & namespacesD,H/ fns(np[;1]3 4)/np[;0]>,D5 n_ may be several names. )EVLEVEL 2 or ml 2 onlyD,(nl)14 0H danb 1999 pdef a la Sharpuw0<` 18n_(0=r_)n_ to keep, to define0<as Pchk epi,6names1r penclose names,4hC nfx (2,n)((nep)'as t'),epd4 -rPnames x;io  id1o_ r@ Iid'Package' $testx' notr'$@ DanB 19980824 select elements from Package@4Jas 2 2 1 3 'io s xs as' Pnc p)4\  $^$ =/'\L ֨+L0Di cn(rr1rcn' ')/cn,' ',cn0h l ֨+h葕ȩD  h<: l<M@ ghgij @, c_[r_/v_]2 names are of class 2@4as NPnames(pPack N(/b)/dis b/s)4T  `ab T`,@ r' '=names(r1r' '=names)/names,' ',names@TpNnscut b' io pp s xs vc vn ep test as ns' 'xs' is unknownerT<l error (182drr_)/ 'cannot define fn'<$% n_n_[1+io;io] $@ؖ DanB 19980824 expunge elements from Packaged@8l test sys vars, unknowns, vars, fns8,8error r/'not in package' ,0/ Pins@PJ only define names in list - 1st erase themP@4 fns'',(+/^\(23fns)' ')fns.48l15:NPnames(p2 3 4 Psel Pack dis s)n88x error ((cn)+/r)/'not in package'89 nlfns r(nd_N_ Pdef n_;F_;O_;r_(4b' '=nl(b1b' '=nl)/nl,' ',nl44T<rr01b/p[;1] unknowns rejected4d Pchk< b_ 4c_ncv_N_((r_r_)=r_)/r_N_.<8Ȥ accept just any format for left arg8(T nd_(0r_)/n_[;io] ((l N_1c_ penclose n_(8 there is a bug somewhere for Dyalog8,/ test suite for Pack et al,l01:$R_N_ Ppdef n_;rlU$ pPack 'tmp'w 4 default to all fns/ops in package4<(2=1,p)0 1st a string, 2nd a matrix<,@ (r_b_/b_c_1 2)18,4X cn(rr1rcn' ')/cn,' ',cn d'4@ change class 0 into 1, find all vars values@< n_(~n_[;io]'sc''SC''ec''EC')n_<LT  $d mL X0 r' notr' 8 (rl321321)16 protective pdef? 8,̞ v_[b_/b_0=c_] '''''' ',(xr(cl,0)[p[;io]names](8n_(n_[;r_]N_)n_ anything to do?l'8(P (0x,(1,x)[;0])0 ($- c_c_1c_' '=n_ $$(0=nc 'v_')7 $$X (82dr cn)4 e\$ (n(n2)2*n  & (nc 'nl')6 ,С O_'name not in package'5,L already has potential for PPdef. All we need to doL8$ r_' '=N_(r_1r_N_=' ')/N_,' ',N_8L| cn can be a list (cm or cv) of names or a class (ex: 2)dL(hr_o_ Pins n_;io;id(tF ֨+,t•䩕tLDt4X DanB 1997 replace by proper fn4 ) error r_/O_ H left arg is names or classes to pick from right argbHH8 error(0(nl1b penclose nl)fns)/'domain error'esH,error r/'domain error'v,(vn23   r_' notr'  n_,' ',n_l  x 0  (010N_)11 $ep2 1id (0 3'')$$A r(Pchk p)1n $t/ IO0 ` rx% io0 L cn can be a list (cm or cv) of names or a class (ex: 2)nL04as 2 3' io test ' Pnc p0dM0 ensure names are in package c0hML4rnc (''=1id)id APL2 is the only one tolerant of L r_0,n_[;2+io] l r_PisID v_r  id_'Package' L( milinta 1999 lock items (default all fns/ops) in packageL4 r1+/bp[;0] n sanity checks4io0  4 r_' notr'  (0n_=' ')21 $$r_2 1( id_), r_e$( Pval - '', var, fnu(PR_Pdef n_l r_DEFr_ N_N_ '4* n_r_n_ 0$r_N_,c_,[io+.1]v_$trr4Ldas ~1Pchk'' 1 3 4.4 (1 2) 'c' 'string' (2 2'mat') (0)dL4 r(((Pnc p)cn)Pnames p) Psel p 4 ֨+襕(x|ķ(h@ DanB 19980824 name class of names in package@0d- nl valid. lock them 1 by 1x0,H 0D o_r_o_8 r_1+io @ np1,op x b_b_r_ c_c_-b_ T;; Functions to simulate pack series of system fns. Each package is a 21, level 2 minimum deep nested array of an identifier and a 3 col table, each row being the name, the class, the value. The behavior is similar to SHARP APL's functions. Differences lie in handling of objects. Operators are accepted and objects are defined in proper namespaces where appropriate. Functions are available for both APL2000 and Dyalog APL (see SHARP APL documentation for details). Pack packs items or one item with a specific value Any name is valid (like xx) Pchk checks a variable is a valid package Pdef defines the values in the environment (won't wotk for xx names) Pex removes items in a package Pins inserts items in a package Plock locks fns/ops in a package Pnames returns the names in use in a package Pnc returns the classes of each item in a package Ppdef defines values protectively Psel selects items from a package Pval returns the value of a specific item in a package (vr for fns/ops) DanB 1998 TT  jj Tase RFI R' $(' '10VALUE)/0 $(* if VALUE is numeric(D fsMOD: (1R)0 R is NOT scalar 0, 1 is good toohk D$ 0@n_c DEFAULT character string R by VALUE if it 0@$R_NRR DEFAULT VALUE$|\ +|ɕ(ȕ<ɕ8ʕʕ(ɕȕȕȕ|ȕ| R1/VALUE \(R0)MOD 8Ynl38CMDMORSESTR DLDLSUPPERCASE?099SYNTAX ERROR CMDMORSE[7] SOUND TESTF  ^9:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~LP vr$q _SortListview (@o1d4CMDWINCALLSPER2FREQdMorse`print@DELETECMDUSAVE6CLOSEUFFINDCOMPOPENUFSUBOPENUFTGRPCMDabcĒCOMMITTESTxasub1 UETCtc /Q UVXrZR[ !%&*  !"%%%&'()*+,../0123456789:;<=??@ABCGGGGHIJKMMNPP Delimiters: spaces not in quotes or 1st quoteH(e t TQ>1Q T=1st QUOTE(  IQ^1Q @0 X The following allows to consider '' properly@PK Delimit each token in the argument and return them delimitedPPh Spaces are used to delimit arguments. '/' delimits switches.PL check for special switch /= to find arguments' delimiterLP process each Switch separately according to their Position0CP$L4:I/S''''=T $$ \QPARMS'''' $X Dan Baronet 1993 - PARSE switches and reset argument. Version 2.2X Example:0 (211,IDLOC '')/''0, dT/PATN ( PATN[P/PT\I]' '(8(/IIT2 0 0 ,IPATN SS Q)L0 8$PARMS[P/P]1d ;$D 30 ",/TDOAPPEND$   V$H| 6 r 8 V, R V, V H4 # , 3 W4,   V, Z-,(|  /(0( H , 3 R(TDM *L R R$," V0" 4UDGH,CM:T1 43 $  , R, 3 Z4,  Z/U, ,,,((  Z+ / X( ?, L3P( > Z/, X X/ X X, 0)P$\Z  Z/ $ RD S ,,HUNBALANCED QUOTESR,,L  R/"E,\p,$R(~\S' [=')/S,   X IOT (  , r( H   5SHADOWEDl30l20l15l01xsvnsvctmptestxtest0rtestpicknsepdiscutasPtestPdescribeb_c_id_v_\Pack/okPchkO_F_nd_PdefPexo_Er_PinsidPisIDغtfnsnpnl]opPlockPnamesclPnco ecmi ''ORles US anbOSse plab pwiis lth[psobl vlloce lbhdenullUNAHNXfşIO1 $ĹCHK:T(IS'=')S $4CMDULOAD Rrmurl  Xvrba XraRCvF 7)0fERwEF50/matXeqT'XcrREDXc MDAXb'DE XlELXrdзMODOXf@MXnVE99 daIdoenyX30EFX20E'X10'Al10DE l5ENs$Lli0`GliXn$Xc14XdfXobH6LISTZFULLl#XfR,UNI,EXs@[Xft8New|XbrNgzCRFROMVR@'Lst0XtreegenFLXml0:z3XnlMXstx\XmvXqz MAXLEVEL3dlDEFAULTPL  L2`9CMDCALLSq=O \XcompareT\/@FXIU.XVHVALUElROVER=Xgensymb ZXNXTt'EXSRXZ XMXPXN0,CMDUNAMES$IG] |AA1hcFN FTIMEBASET-X@PATIOTAlQMTOVOBJNNT@SVAR=TCMDTIES|WHEREOBJcTSFaCMDabc4ROWLENSWHERE&code DllExportFormLI Lfn DLL_TABLE PtpathPso̟bMfileshort=peMextTnotpe|resultarg,FtnHsizeENwhatxEdate@GnewDllExportsjrcaDllImports@pexidx(!ordXnames,eMTOVttopverDllHandler@8 DllInfo[loopRL2S]CM1\MEMTerrB 8CMDDLL^SPARGxdDimportsXRL0rowform1 tE CHKNfileHexports($DllList \TELPRINTOBJ cfnf NDELL3.dosDllTreeQT$edttV [f23dmoreFTIMEREP27 |control31 exitXNNO$J,282627\LJUST`*MAKEUFILE4SWtPARSE@K SearchPath(UCMDUFILELPARMStY<0LJUSTOBJURUMHTYsearchIOBJDATA 25NMW̜L4UFH_24L1L5ؙOBJS s$DATACOMP/bufC$NEXTPLIDBsectFPATNdraTAZPFILE2221201918171615141312DLMLPATnoihZYWVARCVUFILESUTTYPETIEDSRCQPKGNLKJIHERRMSGEKeventCMDUHELPCAX0xF4ignoreUPARMSUCASEOBJUCASETIEUFOVEROBJOVEROUT MATRIFYOBJ 8UTN<.UHDSWIT,UF2930RUDRPTTABpTELPRINTRJUSTOBJIOAGETOPTATIFTNUMOTFOPEN  ;ODEBBJ PIFERRIN@|RJUST MATIOTAOBJ hMATIOTA2]795]:8[6]7efn116]10UCMD2MATRIFY2Dhead1RPNAMESPDEFGLOBALPWGLOBALIOGLOBALELXGLOBALCTGLOBALALXFDBPTf2f1CMDSHOWRO(6L'5Odei4f[;3nXDEBOBJUCMDXimageRESULTDM         f h|dH,lT<$ h dypQ\]#n"~XijDF?}kYUH TVNWP[stqCAw645cu{z_B)