| Calculate WEBCT Alias | |
|
This is the
CALCULATE routine that converts
the string to ASCII values and tests each one. If the value is
between 65 and 90 (inclusive of ends), then it adds 32 to it, so
that an "A" (ascii value of 65) becomes an "a" (ascii value of
97).
Be sure you
have a pointer file built to the appropriate records beforehand.
Do not use /ALL as this can cause problems. If you really all
records, just run through sort so that it builds a pointer to
every record that is not deleted. And don't forget the
/PROGRAMMER qualifier, or it will blow up on you.
==================================================================
RUN
DMS:CALCULATE
myfile/PROGRAMMER
YES
NO
NEWEMAIL$ =
""
FOR Q% =
1% TO LEN(#.EMAIL)
NESEG$ =
SEG$(#.EMAIL, Q%, Q%)
NEASCII% =
ASCII(NESEG$)
ITERATE IF NEASCII% = 39%
NESEG$ =
CHR$(NEASCII% + 32%) IF (NEASCII% >= 65) AND (NEASCII% <= 90)
NEWEMAIL$ =
NEWEMAIL$ + NESEG$
NEXT i%
#.EMAIL =
NEWEMAIL$
YES
======================================================================
NOTES: LEN
returns an integer value of the length of the string
SEG$ returns
a piece of a string
ASCII
converts a string to an ascii value
CHR$ converts
an ascii value to a string
|