This is my version of the popular 'free object' snippet, except you can choose a range of numbers you want your object to be created in.
In case you didnt know, this snippet goes through a range of numbers (specified by you) and finds the next free (unused) object available.
It is easily modified for sounds or images, ect.
Enjoy!

Language: 
Dark Basic Pro
Code: 
obj = freeobj(100,200)
make object cube obj,20
wait key
end

function freeobj(start,finish)
   for i = start to finish
      if object exist(i) = 0
         freeobj = i
         i = finish+1
      endif
   next i
endfunction freeobj
3
Average: 3 (1 vote)