From: "George J. De Bruin"
> I use the following macro, but can't seem to understand its workings.
> Could someone, please explain the buffers to me and how they are used in
> the following:
Well, since it looks like some code I wrote for you, maybe I should
explain it.
It's fairly simple, overall. There are two variables that hold the
ID's to buffers: cBuff, and lBuff. cBuff is the ID for the Current
Buffer. lBuff is the ID for the List Buffer.
Each of the main procs (ie, GetListFile() and GetFindSet()) use the
lBuff and cBuff variables in the following manner:
GetListFile(): stores the ID of the buffer for the current file you are
working on in cBuff. It then creates a new buffer, stores it's ID in
lBuff, then loads your list file in the new buffer. Once it has been
able to successfully create the buffer and insert the file, it switches
back to the buffer ID in cBuff.
GetFindSet(): stores the ID of the current buffer in cBuff, then
switches to the buffer indicated by lBuff. It then goes to the next /
previous or first item (depending on the flag passed into it), and
loads the items on that line into FindStr, ReplStr and OptStr. It then
goes back to the original buffer ID (stored in cBuff).
Basically think of Buffer ID's in this manner: they are a unique way to
identify a file. Buffer ID's are independent of the file name, and
their placement in the file ring.
Does this clear things up a bit? Is there something else that you are
trying to accomplish with this macro? As I said, since I wrote it, I
am probably your best resource to help you with it. Let me
know if you want to tweak something, or there is some behavior that you
don't understand and I will give you a hand with it.
(Also, remember that this was a last minute job I did, and I do see a
couple of things that could give some unusual behavior in it, so if you
need a fix, I'll be happy to do it...).
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)
|