Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text endtext - blank line at top of page 1

Status
Not open for further replies.

desert227

Programmer
Apr 8, 2008
13
CA
code below creates the txt file but with blank line at top of page. Is there some way to prevent that?
SET TEXTMERGE on
STORE FCREATE("c:\TEMP\testit.txt") TO _TEXT && Create low-level file
LOCAL lcxxx
STORE SPACE(900) TO lcxxx
lcxxx="INVOICE_DATE|INVOICE_NUMBER|CLIENT_ID|FIRM_ID|"+"INVOICE_TOTAL|BILLING_START_DATE|BILLING_END_DATE|INVOICE_DESCRIPTION|LINE_ITEM_NUMBER|"

TEXT NOSHOW PRETEXT 7
<<"MYTEST[]">>
<<lcxxx>>
ENDTEXT

=FCLOSE(_TEXT) && Close file
 
Have you tried using the TEXTMERGE() function and STRToFile() instead?

Tamar
 
Will this work
Code:
*SET TEXTMERGE on
STORE FCREATE("testit.txt") TO _TEXT     && Create low-level file
LOCAL lcxxx
STORE SPACE(900) TO lcxxx
lcxxx="INVOICE_DATE|INVOICE_NUMBER|CLIENT_ID|FIRM_ID|"+"INVOICE_TOTAL|BILLING_START_DATE|BILLING_END_DATE|INVOICE_DESCRIPTION|LINE_ITEM_NUMBER|"

=FWRITE(_text,"MYTEST[]"+CHR(13))
=FWRITE(_text,lcxxx)
=FCLOSE(_TEXT)  && Close file
MODIFY FILE testit.txt


This old world keeps spinning round - It's a wonder tall trees ain't layin' down
 
I played around with your code and modified it slightly -- give this a try:

SET TEXTMERGE on
STORE FCREATE("c:\TEMP\testit.txt") TO _TEXT && Create low-level file
LOCAL lcxxx
STORE SPACE(900) TO lcxxx
lcxxx="INVOICE_DATE|INVOICE_NUMBER|CLIENT_ID|FIRM_ID|"+"INVOICE_TOTAL|BILLING_START_DATE|BILLING_END_DATE|INVOICE_DESCRIPTION|LINE_ITEM_NUMBER|"

\\<<"MYTEST[]">>

TEXT NOSHOW PRETEXT 7
<<lcxxx>>
ENDTEXT

=FCLOSE(_TEXT) && Close file

************

The \\ (double backslash) designation directs the output to the same line. Check the example under _TEXT in the help file. However you have to do it outside of the TEXT - ENDTEXT command or the backslashes will merely print as text.

CDAVIS
 
TEXT..ENDTEXT has new FLAGS and PRETEXT options. PRETEXT 4: eleminate blank lines (not just the start line, though).

Bye, Olaf.
 
Thanks CDavis, that works beautifully. I love this site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top