Thread: Ask!
View Single Post
  #209 (permalink)  
Old 08-01-2006, 05:55 AM
billworld2 billworld2 is offline
Member
 
Join Date: Dec 2005
Posts: 31
billworld2 is on a distinguished road
Not sure I follow. To be clear, I'm looking for a way to do a sub-string match based on an object name. Say for example I have a group of objects with the string "-206" in them (along with other text). I want to locate and delete all of the objects which contain "-206" in their name.

What's confusing me in the example below is the association with OBJPROP_TIME1, OBJPROP_TIME2 and OBJPROP_TIME3. I know objects can have up to three time coordinates. I'm not following how that fits in with what I'm trying to do.


Quote:
Originally Posted by Kalenzo
Here is the example:

datetime currentDay = StrToTime(Year()+"."+Month()+"."+Day()+" 00.00");

for(int i=0;i<ObjectsTotal();i++)
{
string name = ObjectName(i);
if( ObjectGet(name,OBJPROP_TIME1) < currentDay && ObjectGet(name,OBJPROP_TIME2) < currentDay && ObjectGet(name,OBJPROP_TIME3) < currentDay)
{
ObjectDelete(ObjectName(i));
return (false);
}
}
return(true);
Reply With Quote