How to Suppress Blank Fields in a Text MergeLast reviewed: August 28, 1995Article ID: Q121411 |
The information in this article applies to:
SUMMARYYou can suppress blank fields in a FoxPro text merge by programmatically creating the TEXTMERGE command and then using macro substitution to execute the command, as shown in the example below.
MORE INFORMATIONThis example assumes that you have a table with three fields
NAME ADDRESS1 ADDRESS2and that you want to perform a text merge that produces output in the following format:
<Name> <Address1> <Address2> <Date> <Body of letter>If the ADDRESS2 field is empty, you want the date to appear directly underneath ADDRESS1, with no blank line where ADDRESS2 would normally appear. The following program illustrates how to create the desired output.
USE <table> SET TEXTMERGE TO outfile.txt SET TEXTMERGE ON SCAN * Test the ADDRESS2 field and return the appropriate text merge * character. cmnd=IIF(EMPTY(address2),"\\","\<<address2>>") \<<name>> \<<address1>> * Use macro substitution to execute the command. &cmnd \<<DATE()>> \ \body of letter goes here * Print two empty lines between records. \ \ ENDSCAN SET TEXTMERGE OFF SET TEXTMERGE TO REFERENCESFoxPro "Language Reference," SET TEXTMERGE command
|
Additional reference words: FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |