From: Rick Dyson [Rick-Dyson@UIowa.EDU] Sent: Monday, January 28, 2002 5:16 PM To: Info-VAX@Mvb.Saic.Com Subject: Re: STR$lowercase ? Steve Lionel wrote: > > On Mon, 28 Jan 2002 17:32:49 GMT, Rick Dyson > wrote: > > >There is a STR$UPCASE system service in the STR$ system, but I have a user that > >would like to force lowercase in his Fortran program and I can't quickly find > >an answer to his question. Is there such a pre-existing VMS service or function > >that can be easily called from a Fortran program? > > One can call LIB$MOVTC with LIB$AB_LOWERCASE as the translation table. > The catch is that you have to hand-craft a descriptor for this, but > it's easy to do. Here's an example: > > character* 10 old,new > external lib$ab_lowercase > integer*4 tabledesc(2) > old = 'ABCDEFGHIJ' > tabledesc(1) = 256 > tabledesc(2) = loc(lib$ab_lowercase) > istat = LIB$MOVTC (old,' ',tabledesc,new) > write (*,*) new > end Excellent Suggestion Steve! I was unaware of that Library service. With your help, I have written this which appears to work. Does anyone see any problems with it? It is not documented nor tested for robustness, but it appears to work with a simple test program I through together... Integer Function Str$LowerCase (Input, Output) include '(LIB$ROUTINES)' Character*(*) Input, Output Integer TableDesc (2) External Lib$AB_LowerCase Str$LowerCase = -1 TableDesc (1) = 256 TableDesc (2) = Loc (Lib$AB_LowerCase) Str$LowerCase = Lib$MovTC (Input, ' ', TableDesc, Output) Return End THANKS AGAIN! That was pretty fast too! Rick