Quote: "Mine checks the same as yours but in more lines."
Not quite. Your example checks to see if a single object (2) exists.
I'm under the impression that he wants to check to see if a group of objects exist - not just one object.
Quote: "more complicated for a newcomer(As i dont get it al all,and i'm not new)"
You're right, I should have explained it - sorry about that.
NumObjExisting is a counting variable and is set to 0 in case the routine is called multiple times. If we don't set it to 0 then subsequent calls to it would simply keep incrementing the value from the last time.
The For Next loop counts from the number of the first DB object in the range to the last. The example I posted assumes that the objects being tested are from 100 to 150.
Each time through the loop, the line:
Inc NumObjExisting, Object Exist(N)
...will check to see if the object being tested exists (No=0 Yes=1) and add the returned value to NumObjExisting.
At the end of the loop, if all the objects tested have been deleted, then NumObjExisting will equal zero.
If NumObjExisting is anything other than zero then it contains the number of objects left. Eg: If NumObjExisting equals 15 then there are 15 DB objects still existing in the range.
It's a bit like having a game of 3D Breakout. The blocks are all DB primitives numbered 100 to 150 and the level ends only when all the blocks have gone.
My snippet would allow you to detect that all the blocks have been deleted and the level complete.
TDK_Man