From: | Geoff Bannoff |
To: | Geoff Bannoff |
After running the page parser, include
=sys(1104)
to purge things cached in memory.
Including sys(1104) after each web page is parsed allows all 73 recently updated files to be parsed without any file corruption.
.. Geoff
I found a problem with the web page parser if I'm updating a lot of files.
My standard "start" program parses any web pages that I have updated in the last 3 days. Yesterday I updated about 30 files, and another 40 today. When I parse all 70 files, the parser consistently mangles 47th one. Restore the 47th web page and generated file from a backup, and it no longer gets parsed (as it now has an older date), but the next time I run the parser on the remaining 69 files, the 47th file gets mangled. Restore that web page and generated file from the backup, and the new 47th file gets mangled.
If I parse a smaller number of files--say just all the ones from yesterday, or just all the ones from today, the code gets generated without any problems. So it's not something in my code--it's in the parser.
When a file gets mangled, all the stuff at the top of the file gets lost--the usual stub and all the procedures I wrote--are lost. Here is the beginning of a mangled file:
Header = null form1 = null lblTitle = null ErrorDisplay = null txtAddress = null lnkGeocode = null txtLatitude = null txtLongitude = null btnGeocode = null lblGeoAddress = null txtQty = null ddlFile = null CTL0013 = null CTL0015 = null btnGo = null btnCancel = null grdNearby = null lblFoot = nullHIDDEN CTL0021 CTL0021 = nullFUNCTION Initialize(loPage)LOCAL __lcHtmlDODEFAULT(loPage)THIS.Header = CREATEOBJECT("wwwebhead",THIS.Page,"Header")THIS.AddControl(THIS.Header)
There is nothing before this in the file. Everything has gotten overwritten.
A workaround is to count the number of files being parsed, and reset the parser, like this:
m.nFiles=ADIR(aFP,'C:\inetpub\wwwroot\fpp\*.fp') && list of all web filesFOR m.nCount =1 TO m.nFiles* check modification dateIF aFP[m.nCount,3]>DATE()-3 m.pcount = m.pcount + 1IF m.pcount> 30RELEASEPROCEDURE WebPageParserSETPROCEDURETO WebPageParser additive m.pCount = 0endif ? m.pcount,' parsing',aFP(m.nCount,1) oParser.ParseToFile('c:\inetpub\wwwroot\fpp\'+aFP(m.nCount,1))ENDIFendfor
Maybe it takes about 47 files to overflow a string somewhere in WebPageParser?
It's been awhile since the parser has mangled any of my files, and we have backup system in place to handle that eventuality. But it would be nice to get rid of this problem.
.. Geoff