[Tutor] Recording and eliminating continuation lines
alan.gauld@bt.com
alan.gauld@bt.com
Wed Nov 6 12:45:20 2002
Yu could use the technique used by video editor programs.
Create a file that stores the character position of the breaks
(the timecode of scenes in video terms). Then read the whole
thing into a single string. Manipulate the string9assuming you
don't delete chars of course - if you do you need to update the
char counters beyond the deleted character.
Then when you need to know the physical line number simply find
the current index and see which line it corresponds to by
comparing the index with the line break counts...
HTH,
Alan g.
Author of the 'Learning to Program' web site
http://www.freenetpages.co.uk/hp/alan.gauld