"Beginning installation of cmd-lsedit... @prog cmd-lsedit 1 99999 d 1 i ( cmd-lsedit: $Date: 2004/02/20 17:10:09 $ $Revision: 1.3 $ Author: --------------------------------------------------------------------------- ) ( $Log: cmd-lsedit,v $ Revision 1.3 2004/02/20 17:10:09 feaelin Colorized the responses. Revision 1.2 2001/01/22 05:27:18 feaelin Added lscopy and lsmove commands Revision 1.1 2000/01/25 17:57:29 feaelin Initial revision ) $include $lib/lmgr $include $lib/edit $include $lib/editor $include $lib/strings $include $lib/mv-cp $include $lib/glowstandard $def .atell me @ swap ansi_notify $def LMGRgetcount lmgr-getcount $def LMGRgetrange lmgr-getrange $def LMGRputrange lmgr-putrange $def LMGRdeleterange lmgr-deleterange : LMGRdeletelist over over LMGRgetcount 1 4 rotate 4 rotate LMGRdeleterange ; : LMGRgetlist over over LMGRgetcount rot rot 1 rot rot LMGRgetrange ; : lsedit-loop ( listname dbref {rng} mask currline cmdstr -- ) EDITORloop dup "save" stringcmp not if pop pop pop pop 3 pick 3 + -1 * rotate over 3 + -1 * rotate dup 5 + pick over 5 + pick over over LMGRdeletelist 1 rot rot LMGRputrange 4 pick 4 pick LMGRgetlist dup 3 + rotate over 3 + rotate "^SUCC^< List saved. >" .atell "" lsedit-loop exit then dup "abort" stringcmp not if "^INFO^< list not saved. >" .atell pop pop pop pop pop pop pop pop pop exit then dup "end" stringcmp not if pop pop pop pop pop pop dup 3 + rotate over 3 + rotate over over LMGRdeletelist 1 rot rot LMGRputrange "^SUCC^< list saved. >" .atell exit then ; : do-delete "^SUCC^List to be deleted is as follows:" .atell 2 pick 2 pick LMGRgetlist EDITdisplay "^FAIL^Enter YES if you are sure you want to delete the list." .atell read "YES" stringcmp not if swap "#" strcat remove_prop "^SUCC^List removed." .atell else "^INFO^List removal aborted." .atell then ; : do-copy swap "^INFO^Enter the destination object or '.' if you are copying to the same object." .atell read dup "." stringcmp not if pop 2 pick else strip dup not if "^FAIL^Invalid object." .atell depth popn exit then match dup not if pop "^FAIL^I don't know what object you mean." .atell depth popn exit else dup #-2 dbcmp if pop "^FAIL^I don't know which one you mean." .atell depth popn exit then then me @ over owner dbcmp not me @ "w" flag? not and if pop pop "^FAIL^Permission denied." .atell exit then then "^INFO^Enter the destination property or '.' if you are copying to the same property." .atell read dup "." stringcmp not if pop 2 pick else dup not if "^FAIL^I didn't understand that list." .atell depth popn exit then "/" swap strcat begin dup "//" instr while "/" "//" subst repeat dup "/@" instr over "/~" instr or me @ "wizard" flag? not and if "^FAIL^Permission denied." .atell depth popn exit then then "#" strcat 3 pick "#" strcat 3 put copy-prop if "^SUCC^Copy successful." .atell else "^FAIL^Copy failed." .atell then ; : do-move swap "^INFO^Enter the destination object or '.' if you are copying to the same object." .atell read dup "." stringcmp not if pop 2 pick else strip dup not if "^FAIL^Invalid object." .atell depth popn exit then match dup not if pop "^FAIL^I don't know what object you mean." .atell depth popn exit else dup #-2 dbcmp if pop "^FAIL^I don't know which one you mean." .atell depth popn exit then then me @ over owner dbcmp not me @ "w" flag? not and if pop pop "^FAIL^Permission denied." .atell exit then then "^INFO^Enter the destination property or '.' if you are copying to the same property." .atell read dup "." stringcmp not if pop 2 pick else dup not if "^FAIL^I didn't understand that list." .atell depth popn exit then "/" swap strcat begin dup "//" instr while "/" "//" subst repeat dup "/@" instr over "/~" instr or me @ "wizard" flag? not and if "^FAIL^Permission denied." .atell depth popn exit then then "#" strcat 3 pick "#" strcat 3 put move-prop if "^SUCC^Move successful." .atell else "^FAIL^Move failed." .atell then ; : show-help "Usage:" .atell "lsedit = - Edit " .atell "lsdel = - Delete " .atell "lscopy = - Copy " .atell "lsmove = - Move " .atell " Copy can be abbreviated 'lscp' and move can be abbreviated 'lsmv'." .atell ; : cmd-lsedit .noguest dup "#help" stringcmp not if show-help exit then "me" match me ! "=" .split .stripspaces swap .stripspaces dup not if "^INFO^You must specify a listname. Syntax: " command @ strcat " =." strcat .atell pop pop exit then swap "/" swap strcat begin dup "//" instr while "/" "//" subst repeat dup "/@" instr over "/~" instr or me @ "wizard" flag? not and if "^FAIL^Permission denied." .atell pop pop exit then swap strip dup not if "^INFO^You must specify an object. Syntax: " command @ strcat " =." .atell pop pop exit then match dup not if pop "^INFO^I don't know what object you mean. Syntax: " command @ strcat " =." .atell pop exit else dup #-2 dbcmp if pop "^INFO^I don't know which one you mean. Syntax: " command @ strcat " =" .atell pop exit then then me @ over owner dbcmp not me @ "w" flag? not and if pop pop "^FAIL^Permission denied." .atell exit then command @ "lsdel" instr if do-delete exit then command @ "lsrem" instr if do-delete exit then command @ "lserase" stringcmp not if do-delete exit then command @ "lscopy" stringcmp not if do-copy exit then command @ "lscp" stringcmp not if do-copy exit then command @ "lsmove" stringcmp not if do-move exit then command @ "lsmv" stringcmp not if do-move exit then "^NOTE^< Welcome to the list editor. You can get help by entering '.h' >^RESET^" .atell "^NOTE^< '.end' will exit and save the list. '.abort' will abort any changes. >^RESET^" .atell "^NOTE^< To save changes to the list, and continue editing, use '.save' >^RESET^" .atell over over LMGRgetlist "save" 1 ".i $" lsedit-loop ; . c q @register cmd-lsedit=cmd/lsedit @register #me cmd-lsedit=tmp/prog1 @set $tmp/prog1=L @set $tmp/prog1=V @set $tmp/prog1=W3 @action lsedit;lsdelete;lsdele;lsdel;lserase;lsremove;lsremov;lsremo;lsrem;lscopy;lscp;lsmove;lsmv=here=tmp/exit1 @link $tmp/exit1=$tmp/prog1 @set $tmp/exit1=M3 @set $tmp/exit1=/_/de:@$cmd/lsedit #help @set $tmp/prog1=_version:FM$Revision: 1.3 $ "Installation of cmd-lsedit complete.