How to Replace All Tabs in a Memo Field with Spaces

Last reviewed: June 27, 1995
Article ID: Q125439
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5x, 2.6, 2.6a
  • Microsoft FoxPro for MS-DOS, versions 2.5x, 2.6, 2.6a

SUMMARY

This article shows by example how to use the REPLACE command to remove Tab characters from a memo field and replace them with spaces (blanks).

MORE INFORMATION

Use the REPLACE command, the STRTRAN() function, and SPACE() function together to locate the Tabs within the memo field and replace them with spaces.

The following example substitutes four blank spaces for each Tab character. You can control the number of spaces inserted by increasing or decreasing the numeric value in the SPACE() function.

   REPLACE ALL <memo_name> WITH STRTRAN(memo_name,CHR(9),SPACE(4))

Memo_name represents the name of the memo field in the database. The CHR() function identifies the tab character by its ASCII value. The SPACE() function places the specified number of blank spaces in field.

The REPLACE command processes all the records in the table. You can use the FOR clause of the REPLACE command to limit the command to specific records.


Additional reference words: FoxWin FoxDos 2.50 2.50a 2.50b 2.60 2.60a
KBCategory: kbprg
KBSubcategory: FxprgBrowse


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.