21393RE: [Clip] Re: Problems with clip and deleting between text
- Jan 4, 2011When debugging clips, I copy a small portion of a larger document and paste it into a new document, then run the clips
on that. It doesn't need to be saved first. That way, you can have just the item(s) you are looking for, the clips run
fast, and you can undo your way back through it to see what was done, and when. You can also step back through it using
redo. This way, you gain an understanding of exactly what your clips are doing, and in what order. It is similar to
using debug, but is easier to manage, and you can reverse direction any time you need to.
I also have a 'scratchpad' clip where I try things out. Just paste one or a few lines of clipcode there, and run it on
your small document. As each bit of code is made to work right, give it its own home or add to an existing clip and then
build some more. Use ^!GoTo Exit in your main body of clips to halt execution where you want it, then use your
scratchpad clip to carry it from there on. That lets you run through your tested clips first, then stop exactly where
needed to test the next thing.
In this example, it would have run correctly, apparently, until the large file was attempted. That would tell you the
code is right, but there is another problem. A large file would have a large undo buffer also, so your main memory could
be exhausted, causing the swap file to become active. That's a much slower process, which could then introduce timing
errors. This can be tested for by stopping other programs, using Task manager to stop unneeded background processes, and
starting with a fresh copy of the large document, so there is no undo buffer in place. Depending on resources, that
could be enough to get it to run correctly.
Recipe formatting tools:
From: email@example.com [mailto:firstname.lastname@example.org] On Behalf Of mikeyboy351
Sent: Tuesday, January 04, 2011 4:48 AM
Subject: [Clip] Re: Problems with clip and deleting between text
I tried adding a delay of up to 20 just before the text was selected, after it was deleted and after the jump to the
previous position at the start of the loop all to no avail. there was still clip text appearing in my loaded file and
sometimes the text was not replaced. I even tried setting the debug option but with over 4000 lines of text it is not
really an option. The files are 40M a piece and I have 4 of them to process.
In the end I broke the 40M files into 3 (one for each month of takings) and retried and lo and behold even without the
delay everything works fine. I am not sure why but I have solved the problem to some extent, the next thing to do is to
automatically split the file... but that is for another day.
The learning curve has been rather steep as this is my first foray into clip programming but I will persevere. Thanks
for the help and suggestions.
[Non-text portions of this message have been removed]
- << Previous post in topic Next post in topic >>