[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re[2]: E-mail generator




     Regarding "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."

     The quote is no problem once you know that chr(39) is the single quote
     mark. You can assign it to a string or refer to it directly. Try to
     find an old BASIC book and get codes for the special characters there,
     or an IBM 'Green Card' for EBCDIC or ....

     From there it takes a few loops and prints to be sure you got the
     right character set but they can be found and stripped using SUBSTR.

     I use this little routine to add quotes for selecting based on user
     input:

     Begin-Procedure QuoteIt (:$QuoteParm)

      LET $TEMP1=''
      LET $QUOTE = CHR(39)
      CONCAT $QUOTE WITH $TEMP1
      CONCAT $QuoteParm WITH $TEMP1
      CONCAT $QUOTE WITH $TEMP1
      LET $QuoteParm=$TEMP1
     End-Procedure






Rick
______________________________ Reply Separator _________________________________
Subject: Re: E-mail generator
Author:  "gracen duffield" <gduffiel@tdhca.state.tx.us> at internet
Date:    4/22/1999 4:12 PM


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