Return characters not printing

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bonbon
Posts: 62
Joined: Thu Jul 17, 2008 11:48 pm

Return characters not printing

Post by bonbon » Sun Aug 09, 2009 1:49 pm

I'm trying to set up a simple report from a database, using the Ebook "Printing in Revolution" as a starting point. It's going OK, except that when I move data into the "holding" field, carriage return characters (Asc 10) are going missing.

This is the sort of thing I'm doing, within a loop:

Code: Select all

      set the htmlText of line LineToAdd of field "HoldContents" of card 1 of stack "PrintStack" to revDatabaseColumnNamed(curID, "EX_Description")
      put LineToAdd + 1 into LineToAdd
The result: field "HoldContents" ends up with all of the exercise text, word-wrapping nicely, but with no white space where the CRs used to be - very hard to read !

Any ideas ? Thanks.

(PS: I've checked that there really are no CRs by doing a "replace cr with LF in field ..." - no little boxes showed up, which is what LFs look like on Windows. I also checked that there really are CRs in the database, using a hex editor.)

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Sun Aug 09, 2009 1:58 pm

Hi bonbon (what a sweet name :))

This is HTML!

HTML does not know the CR or RETURN!
In HTML new lines are created with TAGS like:
<p>THis is the first line</p><p> this is the second line AND <BR> this is the third line in the same P TAG! Amazing isn't it?</p>

Know what I mean? Valid HTML can be just ONE loooooong line.

So you need to modify the retrieved (hmtl source) text from the database.


Best

Klaus

bonbon
Posts: 62
Joined: Thu Jul 17, 2008 11:48 pm

Post by bonbon » Sun Aug 09, 2009 2:28 pm

Thanks Klaus - I'll have a go at that.

Post Reply