Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] Operating on text in long files

Expand Messages
  • jxz
    Thanks a lot Hugo, hrs & Jody for helping with this. I ve found what was wrong. Using debug showed that it s the ^!Jump line_start line which is causing the
    Message 1 of 16 , Aug 26, 2004
    • 0 Attachment
      Thanks a lot Hugo, hrs & Jody for helping with this.
      I've found what was wrong.

      Using debug showed that it's the
      ^!Jump line_start
      line which is causing the backwards jump. Eliminate that
      and the clip works fine - at least on everything I've tried
      it on so far.

      To recap, within the limits of my testing: the trouble
      occurs on Ntb Std, Win98 se, with version 4.00.834.839 of
      riched32.dll, in long files - between around 50k down and
      the ending few kb of the file.

      John


      hsavage wrote:
      >
      > jxz wrote:
      > >
      > > Hugo wrote:
      > >
      > >> I've never seen this... If you could send us the clip we could
      > try
      > >> out if the same thing happens on our side.
      > >> Regards,
      > >> Hugo
      > >
      > > That's quite possible. But just prior to responding to you,
      > > I used Ntb Std's menus to alter multiple spaces to single
      > > ones, towards the end of a 650k file, and when it had
      > > finished the whole of the file was selected (and had
      > > presumably been operated on - I didn't check).
      > >
      > > the last line just being a debugging aid.
      > > S row & col are the start ones, E the end ones, the
      > > algorithm being:
      > > - record the initial cursor position
      > > - do the find, make sure cursor is at start of line
      > > - record the ending cursor position
      > > - jump back to initial cursor position
      > > - select down to end cursor position
      > > - do a copy
      > >
      > > Kind of you to spend time on it
      > > John
      >
      > John,
      >
      > I performed the single-space conversion on a file over 34mbytes in
      > size, if nothing is pre-selected whole file is operated on, and
      > left in selected state, otherwise, only pre-selected text is
      > operated on.
      >
      > As for your clip, it works correctly, exactly as written, and as
      > you described above, at the end of the same 34mb file. I'm
      > pasting your clip, commented, slightly revised, and a revised,
      > hopefully more efficient clip, using most of your code below it.
      >
      > Three important things to note, my OS is XP, the testfile size is
      > far greater than you specify, set wordwrap off any time you
      > operate directly on any text file, you can always turn it back on
      > at the end of clip.
      >
      > H="Find delimiter Test"
      > ; 3 lines added,
      > ; 1. sets all variables to Zero,
      > ^!ClearVariables
      > ;
      > ; 2. turns wordwrap off so your clip gets an accurate line
      > reference count,
      > ; linecount isn't accurate, at least in Pro, with wordwrap on.
      > ^!SetWordWrap 0
      > ;
      > ; 3. so you can track clip operation line by line.
      > ^!SetDebug 1
      > ;
      > ; sets cursor position Starting Row:Column
      > ^!Set %sRow%=^$GetRow$
      > ^!Set %sCol%=^$GetCol$
      > ;
      > ; finds, selects, first underscore delimiter Forward From Cursor
      > Position
      > ^!Find "__________" TI
      > ^!IfError EXIT
      > ;
      > ; jumps to column 1 on delimiter line thereby Deselecting The
      > Found Delimiter
      > ^!Jump LINE_START
      > ;
      > ; sets cursor position, Ending Row:Column
      > ; redundant in this clip, except for visually establishing Ending
      > Row:Column
      > ^!Set %eRow%=^$GetRow$
      > ^!Set %eCol%=^$GetCol$
      > ;
      > ; moves cursor back to Starting Row:Column
      > ^!SetCursor ^%sRow%:^%sCol%
      > ;
      > ; selects from -starting Row:Column -ending Row:Column
      > ^!SelectTo ^%eRow%:^%eCol%
      > ;
      > ; copies selection to clipboard
      > ^!Keyboard CTRL+C
      > ;
      > ; presents info box showing Starting Row:Column, Ending Row:Column
      > ^!Info Start row ^%sRow%, col ^%sCol%^%nl%End row ^%eRow%, col ^%eCol%
      >
      > H="Find delimiter Test1"
      > ^!ClearVariables
      > ^!SetWordWrap 0
      > ^!SetDebug 1
      > ^!Set %sRow%=^$GetRow$
      > ^!Set %sCol%=^$GetCol$
      > ^!Find "__________" TI
      > ^!IfError EXIT
      > ^!Jump LINE_START
      > ;
      > ; redundant lines deactivated
      > ;^!Set %eRow%=^$GetRow$
      > ;^!Set %eCol%=^$GetCol$
      > ;^!SetCursor ^%sRow%:^%sCol%
      > ;^!SelectTo ^%eRow%:^%eCol%
      > ;
      > ; altered ^!SelectTo line added
      > ^!SelectTo ^%sRow%:^%sCol%
      > ^!Keyboard CTRL+C
      > ^!Info Start row ^%sRow%, col ^%sCol%^%nl%End row ^%eRow%, col ^%eCol%
      >
      > hrs
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.