Euphoria 'For' loop alters HTML output at browser....
- Posted by John F Dutcher <John_Dutcher at urmc.rochester.edu> Aug 04, 2004
- 467 views
The Euphoria code below generates an HTML page (horizontally scrollable thanks to the knowledge of the forum readers). If I test by 'cutting off' the code after the first 'puts(1,...) which generates the table 'heading' cells (by adding the 'end' tags for the table, div, body and html at that point...the browser displays the 'heading line' and the table 'header' just as expected, with the table header directly underneath the 'heading'. As soon as the 'for i = 1 to 100 do' is added which formats the 'detail cells' of the table, two things happen: 1) The 'detail cells' are added immediately under their 'header cells' as expected, in a perfect table display 2) BUT the table in its entirety has been displaced in the browser display by two or more screen lengths (vertically) of white space from the original 'heading line' (<H1>...</H1>). It's as though the injection of Euphoria code needed to produce the detail 'data' affects the display from the 1st 'puts(1,..)' that produced the 'header' cells ???
#!c:\Euphoria\Bin\exw.exe include machine.e without warning crash_file("error-messages.txt") -- build html page: integer fn sequence line fn=open("bcare_remit.txt","r") if fn > 0 then line = gets(fn) else puts(1,"Unable to open the disk file\n") abort(1) end if puts(1, "Content-type: text/HTML\n\n" & "<html LANG=EN><head>" & "<title>BCH Remittance Splitter</title></head>" & "<body style=\"color:Blue\">" & "<div style=\"text-align:center\">" & "<H2>BCH Remittances for 7/28/04</H2>" & "<table style=width:2000px; border=1; bgcolor=pink>" & "<tr>" & "<th>Received Date</th>" & "<th>Provider</th>" & "<th>Svc Year</th>" & "<th>Account #</th>" & "<th>Last Name</th>" & "<th>First Name</th>" & "<th>Mid Init</th>" & "<th>Sub Last Name</th>" & "<th>Sub First Name</th>" & "<th>Sub Mid Init</th>" & "<th>Date of Birth</th>" & "<th>HIC Number</th>" & "<th>Location</th>" & "<th>Fin Class</th>" & "<th>Admit Date</th>" & "<th>Dschg Date</th>" & "<th>Pat Type</th>" & "<th>Omega Pat Type</th>" & "<th>TOB</th>" & "<th>Reference Number</th>" & "<th>Pymt Status</th>" & "<th>Rej Code</th>" & "<th>DRG</th>" & "<th>Total Charges</th>" & "<th>CAS Amount</th>" & "<th>Deductible Amt</th>" & "<th>Co-Ins Amount</th>" & "<th>Payment Amount</th>" & "<th>Pat ResP Amt</th>" & "</tr>" ) <-------------- if I cut off here, no problem !! for i = 1 to 100 do <--------- when this is left in, the display <--------- above is actually affected puts(1, "<tr>" & "<td bgcolor=yellow>" & line[1..10] & "</td>" & "<td bgcolor=yellow>" & line[11..20] & "</td>" & "<td bgcolor=yellow>" & line[21..24] & "</td>" & "<td bgcolor=yellow>" & line[25..36] & "</td>" & "<td bgcolor=yellow>" & line[37..64] & "</td>" & "<td bgcolor=yellow>" & line[65..92] & "</td>" & "<td bgcolor=yellow>" & line[93..93] & "</td>" & "<td bgcolor=yellow>" & line[94..121] & "</td>" & "<td bgcolor=yellow>" & line[122..149] & "</td>" & "<td bgcolor=yellow>" & line[150..150] & "</td>" & "<td bgcolor=yellow>" & line[151..160] & "</td>" & "<td bgcolor=yellow>" & line[161..175] & "</td>" & "<td bgcolor=yellow>" & line[176..177] & "</td>" & "<td bgcolor=yellow>" & line[178..179] & "</td>" & "<td bgcolor=yellow>" & line[180..189] & "</td>" & "<td bgcolor=yellow>" & line[190..199] & "</td>" & "<td bgcolor=yellow>" & line[200..200] & "</td>" & "<td bgcolor=yellow>" & line[201..201] & "</td>" & "<td bgcolor=yellow>" & line[202..203] & "</td>" & "<td bgcolor=yellow>" & line[204..227] & "</td>" & "<td bgcolor=yellow>" & line[228..229] & "</td>" & "<td bgcolor=yellow>" & line[230..234] & "</td>" & "<td bgcolor=yellow>" & line[235..237] & "</td>" & "<td bgcolor=yellow>" & line[238..251] & "</td>" & "<td bgcolor=yellow>" & line[252..269] & "</td>" & "<td bgcolor=yellow>" & line[270..284] & "</td>" & "<td bgcolor=yellow>" & line[285..299] & "</td>" & "<td bgcolor=yellow>" & line[300..314] & "</td>" & "<td bgcolor=yellow>" & line[315..328] & "</td>" & "</tr>" ) line = gets(fn) end for puts(1,"</table></div></body></html>")