[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: E-mail generator
I have a procedure that strips quotes, which could be modified.
I take the original value
let $Desc_in = &A.ITM_DESCR
and append a strange, unique string to the end of it:
let $Desc_in = $Desc_in ||'xqz'
then I call the procedure:
do strip-quotes
!----------------------------------------------------------------------
! strip-quotes
!----------------------------------------------------------------------
begin-procedure strip-quotes
#debuga display ' strip-quotes '
let #x = 1
let $Description = ''
while 1
LET $vx = substr($Desc_in, #x, 3)
LET $vxx = substr($Desc_in, #x, 1)
if $vx = 'xqz'
break
else
if ($vxx != '"')
and ($vxx != '-')
and (etc....)
let $Description = $Description || $vxx
end-if
end-if
add 1 to #x
end-while
end-procedure
------------------------------------------------------------
Strip quotes puts a clean description into $description. You would just
need to add code to get rid of your special characters.
single quotes would be the worst. I suppose the code would be ''' or '\'',
but you might have to try a few different things before you find the one
that works.
Gracen Duffield
Texas Department of Housing and Community Affairs
475-3839
-----Original Message-----
From: Sam Spritzer [mailto:SSpritzer@GW.CTG.COM]
Sent: Thursday, April 22, 1999 3:55 PM
To: Multiple recipients of list SQR-USERS
Subject: E-mail generator
I m in the process of creating an e-mail generator which will take an
employee's name and create the user part of an e-mail address. The
requirement is to take the first letter of the first name and marry it to
the last name. For example, Bill Clinton would be bclinton.
Straight names are easy...its the non-letter characters I am having trouble
with such as O'Gore,Al / de Agnew, Spiro / Rodham-Clinton,Hillary.
Does anyone have a "stripper/scrubber" code that they would be willing to
share?
Thanks in advance,
Sam