Not your fault, I figured that out myself!At the end of the proc, the imagenumber and memory never get freed as the proc exits before that. That's one thing that should get fixed. It was a weak moment, sorry about that.
Wish I knew. It works included or inline in the code above (SmegScan) without a problem. In the larger program, inline or included, it dies at that ImageNumber not initialised.Thinking outside the box for a moment, if the procedure works in one codebase and not another, it would be time to look at what the new codebase is doing and how it would affect what's existing.
That's it, I am going to the home for feeble old bunny rabbits:):)