Errors, bugs, questions - page 1218

 
sanyooooook:

here's the thing:

...

My result is higher.

P.S. It's a bit harder to reproduce with you, though. I'll try it later.

 

but as it is:

1. I open a new chart

2. create an object

3. copy the object name from the code

4. change the object name by copying

5. run the script:

void OnStart()
  {
//---
   Print(ObjectFind(0,"UP_Line"));
   if(ObjectFind(0,"UP_Line")==0)
   {
      Print(3);
      //Pos_Buy=ObjectGetValueByShift("UP_Line",0);
   }   
  }

6. I get:

EVERYTHING!!!

 

and previously (in older builds) the names "UP_Line" and "UP_line" could be equal to each other

 
sanyooooook:

turns out the names used to be:

UP_Line and UP_line were calmly equal to each other.

Is that what the problem was?

Use this in MQL4:

#property strict
 
tol64:

Is that what the problem was?

Use this in MQL4:

The code is old, I didn't change anything in it.

Everything was working fine, but today it popped up

 
tol64:

Is that what the problem was?

Use this in MQL4:

and it didn't reveal any errors, because the error is not syntactic but logical, or rather the reason was in different object names ("Line" and "line"), which used to be equal for some reason.
 
sanyooooook:
and this did not reveal any errors, because the error is not syntactic, but logical, or rather the reason was in different object names ("Line" and "line"), which used to be equal for some reason.
So, object names should be stored in variables. )))
 
tol64:
So object names should be stored in variables. )))

This does not save from such an error )

HH: no, actually it does,

but at the time when this code was written, this was not taken into account.

 

Error in documentation or implementation of character constants

https://www.mql5.com/ru/docs/basis/types/integer/symbolconstants

" character constants.
Any single-quoted single character or hexadecimal ASCII character code as '\x10' is a character constant and is of type ushort."

template<typename T>
string typeof( T ) { return ( typename( T ) ); }

void OnStart()
{
        Print( typeof( '\x10' ) );
}

Result: short

This is relevant because f('\x10' ), if overloaded, causes f( short ) to be called instead of f( ushort ) - a different method/function is actually called

Furthermore, both the argument and the result of the built-in string function are ushort

Документация по MQL5: Основы языка / Типы данных / Целые типы / Символьные константы
Документация по MQL5: Основы языка / Типы данных / Целые типы / Символьные константы
  • www.mql5.com
Основы языка / Типы данных / Целые типы / Символьные константы - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

Bild 986.

On collapsed Tools (Ctrl-T), the bar that says Balance/Resources/Margin (double-click on which opened the panel) has disappeared.

Now minimised looks like this


Stretch upwards over the edge is possible, expand by double-clicking on the tab is not, only collapse.