Deleting text-objects doesn't work

 

Hey  guys,

can anyone tell me what is wrong with this code? The text-objects are not deleted and I don't know why...

int OnInit()
  {
   for (int i = ObjectsTotal(); i<=0; i--) {
      if (ObjectType(ObjectName(i)) == OBJ_TEXT) ObjectDelete(ObjectName(i));
   }
   Print("Objects: ", ObjectsTotal());
   return(INIT_SUCCEEDED);
  }
 
mar:

Hey  guys,

can anyone tell me what is wrong with this code? The text-objects are not deleted and I don't know why...


int OnInit()
  {
   for (int i = ObjectsTotal()-1; i>=0; i--)
       {
        if (ObjectType(ObjectName(i))==OBJ_TEXT) ObjectDelete(ObjectName(i));
       }
   Print("Objects: ", ObjectsTotal());  //ObjectsTotal()=0
   return(INIT_SUCCEEDED);
  }
 
>= of course!! :D Thanks !!
Reason: