I just have a few quick things that I use to reduce the number of times I write the same inane code...nothing spectacular, they just help you do your job, that's all. They are not guaranteed to be robust, but I try to write code that does not bite me later.
The first two are functions for getting the next available image and object.
GetNextImageID()
function GetNextImageID()
temp = 1
do
if image exist(temp) = 0 then exitfunction temp
temp = temp + 1
loop
endfunction -1
GetNextObjectID()
function GetNextObjectID()
temp = 1
do
if object exist(temp) = 0 then exitfunction temp
temp = temp + 1
loop
endfunction -1
I hope they help. Certainly, I think it could be applied to other function calls, so be sure to find other places to use the templates!