error on ObjectGet function on build 605

 

I mark bug on ObjectGet function....follow example with debug

I have on chart one label on corner 4

this is my function code

int calc_Yaxis( int corner )

{

int i;

int result;

int objectNumber;

int realObjectNumber;

int cornerDistance;

switch( corner )

{

case 1: cornerDistance = 15; break;

case 2: cornerDistance = 0; break;

case 3: cornerDistance = 0; break;

case 4: cornerDistance = 12; break;

}

Print("-----------------------");

Print("corner = ",corner);

Print("cornerDistance = ",cornerDistance);

objectNumber = ObjectsTotal();

Print("objectNumber = ",objectNumber);

for ( i = 0; i < objectNumber; i++ )

{

Print("------------------i = ",i);

Print("ObjectName(i) = ",ObjectName(i));

Print("ObjectGet( ObjectName(i), OBJPROP_CORNER ) = ",ObjectGet( ObjectName(i), OBJPROP_CORNER ));

Print("OBJPROP_CORNER = ",OBJPROP_CORNER );

if ( ObjectGet( ObjectName(i), OBJPROP_CORNER ) != corner )

continue;

Print("OBJ_LABEL = ",OBJ_LABEL);

Print("ObjectType( ObjectName(i) ) = ",ObjectType( ObjectName(i) ));

if ( ObjectType( ObjectName(i) ) != OBJ_LABEL )

continue;

realObjectNumber++;

}

result = cornerDistance + (15 * realObjectNumber) + 1;

Print("realObjectNumber = ",realObjectNumber);

Print("pixel result = ",result);

return( result );

}


and this is the debug result.........all label are set on corner 4 ( top left ) but the function return always 0


21:24:15 GAP_LAP_searcher EURUSD,H4: corner = 4

21:24:15 GAP_LAP_searcher EURUSD,H4: cornerDistance = 12

21:24:15 GAP_LAP_searcher EURUSD,H4: objectNumber = 5

21:24:15 GAP_LAP_searcher EURUSD,H4: ------------------i = 0

21:24:15 GAP_LAP_searcher EURUSD,H4: ObjectName(i) = GAP_DOWN_0

21:24:15 GAP_LAP_searcher EURUSD,H4: ObjectGet( ObjectName(i), OBJPROP_CORNER ) = 0

21:24:15 GAP_LAP_searcher EURUSD,H4: OBJPROP_CORNER = 101

21:24:15 GAP_LAP_searcher EURUSD,H4: ------------------i = 1

21:24:15 GAP_LAP_searcher EURUSD,H4: ObjectName(i) = GAP_LIST

21:24:15 GAP_LAP_searcher EURUSD,H4: ObjectGet( ObjectName(i), OBJPROP_CORNER ) = 0

21:24:15 GAP_LAP_searcher EURUSD,H4: OBJPROP_CORNER = 101

21:24:15 GAP_LAP_searcher EURUSD,H4: ------------------i = 2

21:24:15 GAP_LAP_searcher EURUSD,H4: ObjectName(i) = GAP_UP_1

21:24:15 GAP_LAP_searcher EURUSD,H4: ObjectGet( ObjectName(i), OBJPROP_CORNER ) = 0

21:24:15 GAP_LAP_searcher EURUSD,H4: OBJPROP_CORNER = 101

21:24:15 GAP_LAP_searcher EURUSD,H4: ------------------i = 3

21:24:15 GAP_LAP_searcher EURUSD,H4: ObjectName(i) = LAP_DOWN_0

21:24:15 GAP_LAP_searcher EURUSD,H4: ObjectGet( ObjectName(i), OBJPROP_CORNER ) = 0

21:24:15 GAP_LAP_searcher EURUSD,H4: OBJPROP_CORNER = 101

21:24:15 GAP_LAP_searcher EURUSD,H4: ------------------i = 4

21:24:15 GAP_LAP_searcher EURUSD,H4: ObjectName(i) = LAP_LIST

21:24:15 GAP_LAP_searcher EURUSD,H4: ObjectGet( ObjectName(i), OBJPROP_CORNER ) = 0

21:24:15 GAP_LAP_searcher EURUSD,H4: OBJPROP_CORNER = 101

21:24:15 GAP_LAP_searcher EURUSD,H4: realObjectNumber = 0

21:24:15 GAP_LAP_searcher EURUSD,H4: pixel result = 13

thanks

eugenio bravetti



 
e.bravetti:

I mark bug on ObjectGet function....follow example with debug

I have on chart one label on corner 4

this is my function code


<removed>

Please use the SRC button to post code . . .
 

"and this is the debug result.........all label are set on corner 4 ( top left ) but the function return always 0"

There is no such setting as corner 4, corners are numbered 0 to 3, 0 Is top left.

I believe that if you enter an incorrect number, such as 4, for setting the corner, it will default to 0.

 

e.bravetti:

...

eugenio bravetti



Hello,

Please use the SRC button when you post code. Thank you.


This time, I edited it for you.

Also note that current build is 610.