"Ever had a moment when [..] reading the manual didn't help"
Oh yeah. It was way back when Lotus Notes was Release 4. LotusScript had just appeared and I had been tasked for creating a Content Management System for an international customer.
Now, you need to understand two things : the first is that, in those days, a Notes database was limited to 2GB in size. The second thing is a little quirk in the system when you're cycling through all the documents (or records, for you RDBMS people) in a particular view.
The manual says (still to this day) that using view.getnextdocument(olddocument) will give you the next document in the view, which it pretty much does. What the manual does not say is that the old document is not deleted from memory when you do that.
So, in those days, it wasn't much of an issue because Notes databases did not contain hundreds of thousands of documents.
But then R5 came out, and the 2GB cap was lifted. And oh boy, did those databases start filling up. That is when I learned, the hard way, that cycling through 85K+ documents, with attachments, in a view could crash the script (thankfully, not the server). The bug report came in from the customer, and I spent days trying to understand why because the script never crashed on the same document (thank God computers are supposed to work on zeros and ones - God only knows what would happen if fuzzy logic were to be used).
In any case, after much head-scratching, I finally clicked that the script always failed after more than 80K documents had been processed. It took me another few minutes and then I wrote this :
Set olddoc = doc
Set doc = view.getNextDocument(olddoc)
Delete olddoc
With that, magically the script always completed successfully from then on (Delete removes from RAM, not from database).
That is one lesson I have never forgotten.