Microsoft KB Archive/125439

{| = How to Replace All Tabs in a Memo Field with Spaces =
 * width="100%"|

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  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
 * }