From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 30-NOV-1989 05:44
To:	MRGATE::"ARISIA::EVERHART"
Subj:	Re: VMS prompts

Received: From UCBVAX.BERKELEY.EDU by GIZMO.SRI.COM with TCP; Wed, 29 NOV 89 22:06:33 PDT
Received: by ucbvax.Berkeley.EDU (5.61/1.40)
	id AA00199; Wed, 29 Nov 89 21:57:00 -0800
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 29 Nov 89 15:47:06 GMT
From: unmvax!bbx!stsabq!jellson@ucbvax.Berkeley.EDU
Organization: Siemens Transmission Systems, Albuquerque, NM
Subject: Re: VMS prompts
Message-Id: <5998@stsusa.com>
References: <3263@jarthur.Claremont.EDU>, <55@gollum.twg.com>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

In article <55@gollum.twg.com>, warner@twg.com (Warner Losh) writes:
> In article <3263@jarthur.Claremont.EDU> jmerrill@jarthur.Claremont.EDU (Jason Merrill) writes:
> 
>>2) Is there any way to bypass DCL's 32-character limit on prompts?  I can't 
>>   go very deep into my directory tree before DCL refuses to accept the new
>>   prompt and simply doesn't change it.
> 
> NO.  The string is stored into a section of memory that has stuff
> before it (the string length) and stuff after it.  So the limit is
> "hard" unless you happen to have complete sources to VMS laying around
> and use them to recompile the entire world.  It would be better to put
> logic in the command file that I mentioned above to chop the prompt
> length at 31, or something.  Most of the CD's that I've seen posted
> don't do this right anyway.

I don't want to post YACD but I do think that my 32 character prompt string
generator does it right.  Use it as you like.  

$ ! display default as prompt string
$ !  (only 32 characters allowed in prompts, use tail of "cwd")
$ !
$ ! first attempt a prompt of the form:          "DEVICE:[DIR1.DIR2]"
$ ! second attempt:                              "[DIR1.DIR2.DIR3]"
$ ! third attempt:                               "[...DIR2.DIR3.DIR4]"
$ ! ensuring that DIR2 is a whole directory name.
$ !
$ pstring := 'F$ENVIRONMENT("DEFAULT")
$ plen    := 'F$LENGTH(pstring)
$ if plen .lt. 32 then goto done
$     first := 'F$LOCATE("[",pstring)
$     if first .eq. "[" then goto loop
$         plen = 'plen-'first
$         pstring := 'F$EXTRACT(first,plen,pstring)
$         if plen .lt. 32 then goto done
$ loop:
$     first := 'F$LOCATE(".",pstring) 
$     plen = 'plen-('first+1)
$     pstring := 'F$EXTRACT((first+1),plen,pstring)
$ if plen .gt. 27 then goto loop
$ pstring := "[..."'pstring
$ done:
$ set prompt= "''pstring' " 

---                                                   ///
John Ellson  ellson@ontap.stsusa.com  602-395-5281   ///   
Siemens Transmission Systems, Inc.,                 ///  
8620 North 22nd Avenue, Phoenix AZ 85021           ///
                                                  ///
"Are you insinuating that my brain consists \\\  /// If my employers had my
of, at bottom, just a bunch of ants running  \\\/// opinions then they wouldn't 
around?"       Douglas R. Hofstadter.         \XX/ need me, would they?

