maximum number of code lines

C

ckirchho

Hallo,

my task is to establish some kind of full text file search in
Javascript. The files and it's contents are fixed, the HTML/JavaScript
pages lie offline on a server.

As far as Javascript cannot access files via any i/o operations, I
have written a routine in Delphi. It parses files in one folder and
generates a Javascrip tfile. The first lines build up a file table,
then the word index is build.

Example:
addTable("Filename1.txt")
addTable("Filename2.txt")
....
addTable("Filenamen.txt")
addIndex("Word1", "1,5,9")
addIndex("Word2", "30,156,1002")
....
addIndex("Wordn", "40")

This script can be rather huge when there are lots of files and lots
of different words in those files. An example script I generated had
approx.160.000 lines.

In additon I wrote a Javascript that contains the needed functions for
building the search Index. When the HTML-file that should realize the
search is opened, the script I built with Delphi is opened and
executed, which calls the functions in the other Javascript and
generates the serach index in the working memory.

In Firefox, the script runs fine, but in IExplorer 7 I get an error
message stating an error in line 32769 of the Delphi generated script.
There is absolutely no error in this line, and I guess it has more to
do with some code line limit, because 32768 is a power of 2.

Is this a known Internet Explorer issue? WHat should I do as a work
around? subdivide the script in multiple scripts, each not longer than
32768 code lines, and than write a wrapper script that calls those
subdivided script?

Are there any other good approaches for buildung and using a search
index in Javascript for realizing a full text search?

Regards,

Christian Kirchhoff
 
C

ckirchho

(e-mail address removed) said the following on 4/16/2007 5:29 PM:











Yes, it is a known issue in IE.
<URL:http://groups.google.com/group/microsoft.public.scripting.jscript/bro...>

The simplest work around would be to have Delphi count the lines. When
it reaches thirty thousand or so insert a function like so:

function IEFix(){}

And then continue on with your lines.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/

Thanks very much, Randy. I tried that, but unfortunately I got the
same error. Did I understand you correctly? You suggest to simply
insert the definition of a dummy function every thirty thousand
lines?

Best regards,

Christian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top