dbTalk Databases Forums  

Re: OT (slightly) Paradox --> Word won't print envelope...?

comp.databases.paradox comp.databases.paradox


Discuss Re: OT (slightly) Paradox --> Word won't print envelope...? in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Robert Wiltshire
 
Posts: n/a

Default Re: OT (slightly) Paradox --> Word won't print envelope...? - 04-19-2008 , 01:57 AM






Quote:
Textstream methods with writestring and/or writeline ?
Is it possible you have a combination of CR or LF,
that is slightly incompatible with the new version ?
Typically, for windows programs, CR/LF , or 13/10 is proper combination.

Can you open LET file with a small script,
and read it in char by char,
to see if you have any odd characters in it ?

scan tc:
ts.WriteString(tc."L7","\13",tc."L6","\13",tc."L5" ,"\13",tc."L4","\13",
tc."L3","\13",tc."L2","\13",tc."L1","\13",tc."CITY ","
",tc."STATE"," ",
tc."ZIP","\13","\13","Dear ",tc."Dear",",","\13","\13")
endScan

Do you spot a difficulty with that?
Personally, I do not like it,
but it might work some of the time,
in some programs.

As I mentioned, typically windows programs expect a
CR/LF sequence as an end of line marker.
CR = ascii value 13 or as an escape sequence \13

The text method writestring, simply outputs what you tell it,
and does not try to add a cr/lf combination.
So, your code is adding the CR, but not the LF.

This might work in some programs,
but it is not typical for windows apps would typically expect.

ts.WriteString(tc."L7","\13",tc."L6","\13",tc."L5" ,"\13",tc."L4","\13",
Quote:
tc."L3","\13",tc."L2","\13",tc."L1","\13",tc."CITY ","
",tc."STATE"," ",
tc."ZIP","\13","\13","Dear ",tc."Dear",",","\13","\13")
Every time you are putting a \13, I would put a \13\10,
or actually, to be cleaner, I would just call the writeLine method.

ts.writeLine(tc.L7)
ts.writeLine(tc.L6)
ts.writeLine(tc.L5)
ts.writeLine(tc.L4)
ts.writeLine(tc.L3)
ts.writeLine(tc.L2)

The write line method will automatically append the CR/LF sequence to the
end of the string,
which then makes it a line.


Quote:
Also, can you say something more about reading the file
character by character? I don't know what you mean by that.
By that I meant,
open up your file with a textstream variable

ts.open(stFilename)
ts.readchar(stChar)
and then test each character of the file for its ansicode

Quote:
I do know that the text looks fine if I open it in notepad.
Understood. Notepad probably adjusts for the non standard format,
rather than insisting that the format be proper.

Unix files simply have the LF character,
ascii value of 10, as the end of line marker.


Hope this helps
Robert Wiltshire









Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.