473,382 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

maximum number of code lines

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

Apr 16 '07 #1
3 2912
ck******@directmedia.de 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/browse_thread/thread/fcb104c0dbd08fbe/49ce2e37e7e980c6?q=32768&lnk=ol&>

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/
Apr 16 '07 #2
On Apr 17, 12:54 am, Randy Webb <HikksNotAtH...@aol.comwrote:
ckirc...@directmedia.de 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

Apr 17 '07 #3
ck******@directmedia.de said the following on 4/17/2007 4:55 AM:

<snip>
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?
It seems that when that thread was going on that the IEFix() function
seemed to clear the errors. I will try to test it some more tonight and
post back about it. It may take breaking it up into separate script blocks.

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Hal Vaughan | last post by:
Is there a maximum length for Javascript program lines? What about strings? Is there a limit on string length? I found some references that said the maximum string length was 256 characters,...
2
by: Kums | last post by:
What is the maximum permissible size of a database? Is there any limitation. What is the maximum # of tablespace's allowed in a database? Thanks for your response.
15
by: Lauren Wilson | last post by:
Access 2K dim MyStr as string What is the maximum amount of text or bytes that this variable can store? Does anyone know?
3
by: Kriston-Vizi Janos | last post by:
Dear Mr. Kern, and Members, Thank you very much for the fast answer, my question became over-simplified. My source code is appended below. It uses two text files (L.txt and GC.txt) as input...
2
by: ArtOfSpeech | last post by:
hi.... Can anyone tell me plz how to set a maximum number of (lines) to a rich text control and show only last linse when number of lines exceeds the maximum number??? i've tried to use...
29
by: garyusenet | last post by:
I'm trying to investigate the maximum size of different variable types. I'm using INT as my starting variable for exploration. I know that the maximum number that the int variable can take is:...
6
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I'm using the VScrollBar and set it as follow: m_vScrollBar.Minimum = -19602; m_vScrollBar.Maximum = 0; m_vScrollBar.SmallChange = 1; m_vScrollBar.LargeChange = 1089; m_vScrollBar.Value =...
7
by: Curious | last post by:
Hi, I need advice on how to set the maximum property of my progress bar. I read a huge file so I need a progress bar when I read it. However, I don't know how many records are there in the...
53
by: Gianni Mariani | last post by:
Do you have a preference on maximum line width for C++ code? I've seen the craziest debates on this most silly of topic. I have witnessed engineers spent oodles of time fiddling with line...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.