Data Access Worldwide Knowledge Base
Article ID 2262 Article Title HOWTO: Print two text fields as one with a CR/LF in Winprint Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2262 KBase Category VDF (GENERAL) Date Created 11/23/2006 Last Edit Date 11/28/2006
Article Text
QUESTION:
I want to print two text fields in a WinPrint2 report. The text needs to be appended to each other but separated by a CR/LF. How do I do that?
ANSWER:
You can move the contents of the text fields to a string variable with the normal string concatenation operator character. So, for example:
Move (Customer.Comments1 * Customer.Comments2) To sText
DFWritePos sText 1.69 iStyle -1 0
To get a CR/LF in between the two text values you can insert a character 13 and a character 10 between the two texts values. The special characters need to be inserted in that order.
So in order to add the first text field, a CR/LF and then the other text field, the above example would have to be changed to:
Move (Customer.Comments1 + Character (13) + Character (10) + Customer.Comments2) To sText
DFWritePos sText 1.69 iStyle -1 0
Contributed By:
Vincent Oorsprong
Company: Data Access Worldwide
email: vincent.oorsprong@dataaccess.eu
Web Site: http://www.dataaccess.eu
Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.
The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access 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.