[comp.os.vms] Including <ESC> in an EDT search string. How?

paul@cernvax.UUCP (paul) (10/26/87)

In VMS EDT (or LSE):

How can I globally replace all occurrences of <ESC> with something else?
  --> ie How do I enter the <ESC> character into the search string?

Paul Burkimsher
Cern, Geneva, Switzerland +41-22-83-47-19
paul@uxocb1.cern
paul%uxocb1@cernvax.BITNET
paul%cern.uxocb1@uk.ac.ean-relay
...!cernvax!uxocb1!paul

The ignorance expressed is entirely my own and does not necessarily reflect the
ignorance of my employers.

minow@decvax.UUCP (Martin Minow) (10/28/87)

A correspondant asks how to include an <ESC> character in an EDT search
string.

In EDT, you can insert any character by using the sequence
	<PF1> character-value-in-decimal <PF1> <Keypad 3>.

<ESC> would then be <PF1> 2 7 <PF1> <KP3>.  I can't remember whether
this works with search strings.

Martin Minow
decvax!minow

atariman@bsu-cs.UUCP (Jeff Scott) (10/28/87)

In article <550@cernvax.UUCP> you write:
>In VMS EDT (or LSE):
>
>How can I globally replace all occurrences of <ESC> with something else?
>  --> ie How do I enter the <ESC> character into the search string?
>
>Paul Burkimsher


The way I do it is to create a short DCL command file with EDT something like
the following that replaces all ASCII 27's with the string <ESC> for printing
reasons.

$ ! Escapeout.com 
$ !   - JDS 1/1/87
$ edit 'p1
$ deck
su /<esc>/<ESC>/ w/notype
ex noescape.txt
$ eod

When you create the above command file with EDT, create the first <esc> by
typing the following: {gold}27{gold}{keypad-3}.  {gold} is the PF1 key on some
treminals, the F6 key on others.  And {keypad-3} is the number 3 on the keypad.

To execute the program you would use the command:

$ @escapeout filename.ext

Where filename.ext is the file you want to take the ESC characters out of.  The
resulting file will be saved as noescape.txt and the input file will be
preserved.  

You can of course change the '<ESC>' with any string or character and you can
also change the output filename from noescape.txt to anything you choose.

I would imagine that it is also possible to create a macro on EDT (or LSE) to
do about the same thing, but I don't know how.

Hope this helps.

--Jeff Scott --------------------------------
{ihpn4|seismo}!{iuvax|pur-ee}!bsu-cs!atariman
atariman@bsu-cs.UUCP
Ball State University, Muncie, Indiana.
---------------------------------------------

rrk@byuvax.bitnet (10/31/87)

The other answers I have seen do not work.  I know of one way to search
for an escape character in EDT:  Use control-K to define a key (I usually
choose "1" on the keypad so I always remember it) It asks for a definition
and you type:

("^[").

The ^[ in the definition is produced by pressing escape twice.  All other
characters are produced by normal keys that echo what they are.  You terminate
the line by pressing <enter>.  You have now defined a key which will, whenever
you press it, search for an escape.  (anything else you want searched for
can also be put in the quotes.  After a search, it becomes the default search
string and you can do mass replaces or whatever:.

cfchiesa@bsu-cs.UUCP (Christopher F. Chiesa) (11/06/87)

In article <14rrk@byuvax.bitnet>, rrk@byuvax.bitnet writes:
> The other answers I have seen do not work.  

My job requires that I explain complex VMS VaxCluster and other concepts to a 
community of people with little or no computer knowledge, yet who want to be
able to perform sophisticated operations after five minutes' instruction.  I
deal constantly with communication gaps, and that's what we may have here...

When the posted solutions about substituting the ESC character said 

"... place in a buffer the command string

SUB /<ESC>/whatever/ W       ..."

notational misunderstandings may have been generated.  You are not meant to
type "slash, less-than, E, S, C, greater-than, slash" into the buffer, but 
rather "the ESC key twice, which will insert the ESCape character which is
displayed as <ESC>"

If that was what you did, don't take it badly; zillions of people HERE do
much the same all the time (one fellow had his Mail in a directory called
[.DIRECTORYNAME] "because that's what it said in the HELP file..."). 

If you did it the right way, I'm curious as to what else you did along with
it, to cause the scheme not to work?

Chris Chiesa, Senior, CS Dept., Ball State University, Muncie, IN