The information in this article applies to:
SUMMARYThe code below shows how to switch the first character with the last character in a field for all records. MORE INFORMATION
The following code demonstrates an easy way to accomplish this:
INTO ARRAY <arrayname>
SUBSTR(ALLTRIM(<fieldname>),2,LEN(ALLTRIM(<fieldname>))-2) ; +<arrayname>(RECNO()) Before the commands are executed, a sample table may look like the following:
After the commands are executed, it will look like:
The first command takes the leftmost character and stores the information in an array for each record. This leftmost character must be stored in this manner; otherwise, the rightmost character will be substituted into the leftmost position in the REPLACE expression, which will cause the resulting records to contain the original rightmost character at the beginning and at the end. These commands work with variable-length character fields. With a few modifications, this code can be quite flexible and useful for string- manipulation purposes and can be adapted to work with other types of fields. REFERENCES
"Commands & Functions," version 2.0 (MS-DOS), pages C3-701 to C3-704,
and C3-659 to C3-660
Additional query words: FoxMac FoxDos FoxWin VFoxWin 2.50 2.50a 2.50b 2.50c 2.60 change reverse alter
Keywords : |
Last Reviewed: December 29, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |