How to delete OBJ_TEXT by int deinit() ?
ObjectDelete()
int deinit()
{
//----
int counted_bars1=IndicatorCounted();
int limit1;
if (counted_bars1>0) counted_bars1--;
limit1=Bars-counted_bars1;
if(limit1>100) limit1=100;
for (int ii=0;ii<limit1;ii++) {ObjectDelete("Point"+Time[ii]);}
//----
return(0);
{
//----
int counted_bars1=IndicatorCounted();
int limit1;
if (counted_bars1>0) counted_bars1--;
limit1=Bars-counted_bars1;
if(limit1>100) limit1=100;
for (int ii=0;ii<limit1;ii++) {ObjectDelete("Point"+Time[ii]);}
//----
return(0);
}
Nothing happen.
// global Variable for all Obj of this Indicator or EA: ObjectCreate(idObj+"..", ..); string idObj = "Point"; ... int deinit() { string sID; int t = ObjectsTotal(); // or ObjectsTotal(OBJ_TEXT); while (t>0) { t--; sID = ObjectName(i); if ( StringFind( sID, idObj ) != -1 ) { ObjectDelete( sID ); } } return(0); }
gooly:
Thank you.
But not work.
sorasit46:
<CODE DELETED>
How to delete only OBJ_TEXT "Point"+Time[i] name ?
Thank you
You have been asked before . . .
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
RaptorUK:
Loop through all the Objects, if they are of type OBJ_TEXT and the name contains "Point" delete . . .
Loop through all the Objects, if they are of type OBJ_TEXT and the name contains "Point" delete . . .
Clue:
| StringSubstr( | string text, int start, int length=0) |
#define ONDA_BEGINS 0 #define ONDA_CONTAINS 1 void ObjectNameDeleteAll(string name, int where=ONDA_BEGINS, int type=EMPTY){ for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){ string on = ObjectName(iObj); if(type != EMPTY) if( type != ObjectType(on) ) continue; if(name != ""){ int iPos = StringFind(on, name); if (iPos < 0) continue; if (iPos > 0 && where == ONDA_BEGINS) continue; } ObjectDelete(on); } } int deinit(){ ObjectNameDeleteAll("Point", ONDA_BEGINS, OBJ_TEXT);
WHRoeder:
Do you really think that the OP will be able to understand that?
This forum is about coding. He should, especially when I gave him the call.
How to delete only OBJ_TEXT "Point"+Time[i] name ?
Thank you