Board index » delphi » File lister/editor for huge text files

File lister/editor for huge text files

I would like some ideas on how to go about the problem I have tried to
set out below (far too verbouse in hindsight but hopefully it is clear).


Impliment  a  huge  text  editor/lister  that  can be used in pascal
programs.   As  a  second  phase   impliment  it  as  an  object  in


I want to program this idea in TP7.

I have code in ASM that achieves what I am  looking  for  in  a  hex
editor.   This  editor  can edit files of virtually any size with no
64kb limit and no arbitrary limit imposed by memory size.


I  would  like some advice as to how to go about this project.  I am
continuosly hampered by lack  of  an  editor type module that allows
listing  and  or  editing  enormous  text  files  unhampered  by  an
arbitrary 64kb limit or even by the systems memory.  I have put  off
doing  this  myself as I thought someone must have already done this
and I would eventually come  across  some code somewhere but in many
many months of searching no code  has  been  located.   I  have  now
reached  the  stage  where  lack of such a tool seriously hampers my
programs.   The  current  program   I   have  developed  (using  the
generously published SGP and SGP-4 units by Dr Kelso) for example is
a satellite tracking program that calculates  satellite  information
and  visibility  data,  Earth-Centered  Inertial  (ECI) Position and
Velocity Latitude,  Longitude,  and  Altitude  Look Angles (Azimuth,
Elevation, Range, and Range Rate) Right  Ascension  and  Declination
(Topocentric)  and  other  data.   The programs input is pre-defined
files of satellite  two-line  element  sets and observer coordinates
and its output is data in the form of text files.

I  have  successfully tested my output against published data and am
very happy that the  output  confirms precisely to expected results.
I have run comparisons against other programs such  as  TrakStr  and
confirmed  the  accuracy of the programs results using various types
of input.  I have implimented  some  of  the algorithms in a TV type
implimentation and am pleased with the look and feel of the  project
so  far.   I  am  continuing to develop the user interface in the TV

BUT!  :-) ...  One feature I think my program should have to make it
look  professional  is  that  the  resulting  text  output  files be
viewable (and 'cut'n pastable') from within my program  rather  than
the  rather  kludgy  approach of requiring users to exit the program
and view the results of  the calculations using other software.  All
works fine provided the output data file is less than  64kb  however
larger files are not able to be loaded in the file editor/lister.

Initially I will impliment a viewer as a standard TV type window but
eventually  I  want  a  more complex window with multiple scrollable
areas and non-scrollable areas  and  selected areas in some portions
of the screen...but thats in the future (I have some ideas on how to
do this from reviewing other pople code; however I find TV very hard
to work with in all but  fairly  standard  ways  but  the  resulting
application  framework  I find stable, flicker free, with good mouse
behaviour which is important to me.  I find TurboJocks TOT libraries
very easy to work with but the dialogue boxes and mouse routines are
slighty flawed [but their window objects and screen writing routines
are superior IMO] which means  I  have the choice of rewriting these
which would not be too difficult or persisting with TV.  I will also
be  attempting  to  convert  the  whole  thing  using  delphi 2 over


Rather than limiting the file to  be  edited to 64k or to the amount
of memory on the system by allocating all  of  memory  in  a  single
block  I  would like to use some sort of file buffering system where
only a portion of the file is  kept  in memory and data is read from
and written to the file as required.

            |____________________________________________| disk file
                     ^buffer anchor
                     <--------------> memory buffer
                        ^grid anchor
                        <--> screen display grid

I have code in ASM that does this and I would like to try to achieve
this result in pascal.

I plan to first attempt this  editor using plain vanilla type pascal
and then attempt rewriting it as a descendant object in TV.  I  have
to do it first as simply as possible because as I stated elsewhere I
find  TV  difficult.  I know I am going to have to brush up big time
on pointers and OOP; I can do it but I am weak in this area.

Can anyone give  any  pointers  to  me  as  to  how  this  might  be
implimented  as  a  pascal  project.   What  sort of data structures
should I use, and any ideas  on  algorithms to achieve it, even just
descriptive ideas might be useful.  The first step will be a  simple
file  viewer  able to scroll forward and back through any sized file
with no menu, buttons etc to  confuse the issue.  All output will be
to the screen with the only commands being scroll  forward/back  and
page  down/up  using  the  arrow  keys or the relevant page down/up
keys.  If I can  do  this  editor  type  commands will be relatively
straight forward [touch wood! :)].

   .////.   .//    Charles Senescall  

>::::::::::\\\     Finger me for PGP PUBKEY           Brisbane AUSTRALIA

   '\\\\\'   \\    <A HREF="">

Re:File lister/editor for huge text files

On Mon, 9 Dec 1996, I wrote:

> I would like some ideas on how to go about the problem I have tried to
> set out below (far too verbouse in hindsight but hopefully it is clear).

Never mind everyone..I found it in (yep u guessed it) SWAG!

Other Threads