Message-Id: <9304011841.AA21837@acs6.acs.ucalgary.ca>
Subject: Editing braces
Date: Thu, 1 Apr 93 11:41:45 MST
From: Joshua Sean Bell <jsbell@acs.ucalgary.ca>

Here's what I use for editing {}s in and out of strings:

fix <object>/<attribute_wildcard>=<old string>|<new string>

&FIX_EDIT object=$fix */*=*|*:
	@dolist lattr(locate(%#,%0,*)/%1)={
		&## [locate(%#,%0,*)]=[edit(get(locate(%#,%0,*)/##),%2,%3)]
	}

The wizard version I have includes the line:
	@chown locate(%#,%0,*)/##=owner(locate(%#,%0,*)) 
This is so I can fix typos and such on other people's objects,
without stealing the attributes from them.

It lets you edit { and } in and out of descs and such, and
accepts wildcard attribute names, just like @edit and ex do.
Obviously, you can't edit |s, but there's always gonna be SOME
delimeter that causes problems, and | aren't ever part of MUSH
code, so there shouldn't be times when neither fix nor @edit can
do the job.

This might make a handy global, +edit or +fix or something.
Obviously, then, it'd need some error checking code (controls()
is handy) to make sure there is something to edit, and that you
can indeed do the operation itself.

Joshua
|"The universe is simply one of those things that happens from time to time."|
|                                                   - Edward Tyron           |
| jsbell@acs.ucalgary.ca  Academic Computing Services, University of Calgary |
