Date:  02/27/2004 01:36:58 PM Msg ID:  001882
From:  FoxWeb Support Thread:  001881
Subject:  Re: Text Memo on web page-spaces problem!
With HTML, consecutive spaces are displayed as a single space.  You have a couple of options:
  1. Replace all spaces with '&nbsp;' (non-breakable space) codes: Response.Write(STRTRAN(mline(budtext,i), ' ', '&nbsp;')+"<br>")
  2. Enclose your list in <pre> tags.  With this solution you will also need to not use <br> tags:
   x=memlines(budtext)
    Response.Write('<pre>')
    for i=1 to x
        Response.Write(mline(budtext,i)+CHR(10))       
    endfor
    Response.Write('</pre>')

 

If you are using <pre> tags and the original text already has carriage returns between lines, you can simply send the text directly to the browser.  Please note that if you have chr(13) + chr(10) you will need to replace them with chr(10) to prevent a blank line appearing between your lines of text:

    Response.Write('<pre>')
    Response.Write(STRTRAN(budtext, CHR(13) + CHR(10), CHR(10)))
    Response.Write('</pre>')

FoxWeb Support Team
support@foxweb.com email

Sent by Bill Mast on 02/27/2004 08:52:42 AM:
Hi,
 
I am trying to output the contents of a memo field (which was populated with the contents of a text file) to a web page.  I create the text by using ? commands, and make it columnar by using ? spac() commands on each line.  This prints to a printer just fine.  I also make sure I'm using a non-proportional font like Courier New.
 
The problem is that the spaces are not translating correctly on the web page, leaving the columnar data to wander all over the place.  Example output:
 
ADMINISTRATIVE MANAG 0.00 1.50 172.74 0.00 0 0.00 0
WORD PROCESSING 0.00 44.00 1794.52 0.00 0 2000.00 90
PRINT ROOM 0.00 7.75 261.98 0.00 0 1000.00 26
ADMINISTRATIVE ASSIS 0.00 128.25 4703.84 0.00 0 50000.00 9
----- ----- ------- ----- --- -------- ---
SUBTOTAL: 0.00 181.50 6933.08 0.00 0 53000.00 13

These should be in columnar format.  If I examine both the source text file and the actual memo field, they are lined up perfectly.
 
Here's the short code I used to output it:
 
    x=memlines(budtext)
    for i=1 to x
        Response.Write(mline(budtext,i)+"<br>")       
    endfor
 
Any thoughts on what might be causing this problem?
 
Thanks very much,
 
Bill Mast