Xref: utzoo comp.os.vms:37530 comp.lang.fortran:5093 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!usc!orion.oac.uci.edu!biivax.dp.beckman.com!dsroberts From: dsroberts@biivax.dp.beckman.com Newsgroups: comp.os.vms,comp.lang.fortran Subject: How to remove all spaces in FORTRAN Message-ID: <1991Apr2.144757.247@biivax.dp.beckman.com> Date: 2 Apr 91 21:47:57 GMT Organization: Beckman Instruments Lines: 35 Alright, FORTRAN gurus, you have been so helpful so far, let's try another. I want to concatenate four strings to make an smtp mail address out of. Each string comes from a fixed length indexed data file in VMS RMS. Each string potentially has trailing (or leading) spaces. This spaces, as far as I can tell, are not valid for my mailer. So, I can: result = 'SMTP%"'//string1//string2//string3//string4//'"' and if there were no spaces, this would be fine. I know I can perform a STR$TRIM on each string and get its length, change the concat to: result = 'SMTP%"'//string1(1:len1)//string2(1:len2)// 1 string3(1:len3)//string4(1:len4)//'"' But that won't deal with leading spaces and seems like a lot of code for what in DCL would simply be: result := f$edit ("SMTP:""''string1'''string2'''string3'''string4'""", - "COLLAPSE") So does fortran have a function (of VMS a library routine) that eliminates all embedded spaces in a string? And please, mail to me, we don't need to clutter up the newsgroups. I'll post a summary, ok? -- --------------------------------------------------------------------------- Don Roberts Internet: dsroberts@beckman.com Beckman Instruments, Inc. Yellnet: 714/961-3029 2500 Harbor Bl. Mailstop X-12 FAX: 714/961-3351 Fullerton, CA 92634 Disclaimer: Always ---------------------------------------------------------------------------