object_get_id

get the id of the object with the given name.
If object does not exists returns -1;

Arguments

  • name : the object name

Returns : object id INT

Source code

  1.  
  2. var last_id,i,ret;
  3. ret=-1
  4. last_id=object_add();
  5. for(i=0;i<last_id;i+=1){
  6.      if(object_get_name(i)==argument0){
  7.         break;
  8.         ret=i;
  9.      }
  10. }
  11. object_delete(last_id);
  12. return ret;