Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > maximum number of code lines

Reply
Thread Tools

maximum number of code lines

 
 
ckirchho@directmedia.de
Guest
Posts: n/a
 
      04-16-2007
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

 
Reply With Quote
 
 
 
 
ckirchho@directmedia.de
Guest
Posts: n/a
 
      04-17-2007
On Apr 17, 12:54 am, Randy Webb <(E-Mail Removed)> wrote:
> (E-Mail Removed) said the following on 4/16/2007 5:29 PM:
>
>
>
> > 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?

>
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: maximum continuation lines in C++ AnonMail2005@gmail.com C++ 6 05-27-2010 11:42 PM
Questions about input lines (maximum length and continuation) Robert Dodier Python 1 07-04-2007 03:46 AM
Creating the maximum number of menus and maximum number of stills rossco DVD Video 2 11-24-2005 09:33 PM
The number name 'System.Web.UI.WebControls' contains more than the maximum number of prefixes. The maximum is 3. mayur ASP .Net Web Controls 2 07-16-2004 05:14 PM
The number name 'System.Web.UI.WebControls' contains more than the maximum number of prefixes. The maximum is 3. mayur ASP .Net 2 07-02-2004 10:35 AM



Advertisments