Errors, bugs, questions - page 1743

 
How can the debugger see what value the function returned via return? I put a breakpoint on return. When I get to it, I press F10. How do I see what came out of return?
 
fxsaber:
How can the debugger see what value the function returned via return? I put a breakpoint on return. When I get to it, I press F10. How do I see what's in return?
shift + F9 ('add watch')
But since apparently everything in your code is built on classes, you can expect about a dozen angry letters explaining how Meta Editore is horrible, bad and inconvenient with debugging))
 
Stumbled across a good example in mine
class A
{
public:
  void operator =( const string Value ) const { return; }

  void operator =( const int Value ) { return; }
};

void OnStart()
{
  const A a;

  a = 0; // implicit conversion from 'number' to 'string'
}
It wasn't obvious in the beginning why the warning. Clever compiler, though.
 
Sergey Dzyublik:
shift + F9 ('add watch')
What do you want to add?
 
A variable to which the function returns a value.
If it does not return anywhere, or if there are several nested calls, create a variable so that the result of the function can be written there and debugged.
 
Sergey Dzyublik:
The variable in which the function casts the value.
If it doesn't return anywhere, or has several nested calls, create a variable so that you can write the result of the function there and debug it.

Well, every clever person can do it with a variable. But I have to, like a fool - without it.

There are a lot of functions like this.

  virtual bool SetProperty( const ENUM_CHART_PROPERTY_INTEGER id, const int Value ) const
  {
    return(::ChartSetInteger(this.chartID, id, Value));
  }

  virtual bool SetProperty( const ENUM_CHART_PROPERTY_DOUBLE id, const double Value ) const
  {
    return(::ChartSetDouble(this.chartID, id, Value));
  }

  virtual long GetProperty( const ENUM_CHART_PROPERTY_INTEGER Property, const int SubWindow = 0 ) const
  {
    return(::ChartGetInteger(this.chartID, Property, SubWindow));
  }
  
  virtual double GetProperty( const ENUM_CHART_PROPERTY_DOUBLE Property, const int SubWindow = 0 ) const
  {
    return(::ChartGetDouble(this.chartID, Property, SubWindow));
  }

And now you have to insert a variable into each of them? Is there any other way?

 
Why can't OBJPROP_YOFFSET be made negative? There is no uint in Help.
 
fxsaber:

And now insert a variable into each one? Is there any other way?

Obviously these functions must be renamed: GetPropertyLong, GetPropertyDbl. Why do they have the same name?

In the future, the developers promised to modify function templates to be able to call them in the following way: GetProperty<long>(...) But you won't make a template virtual.

 
Alexey Navoykov:

Obviously these functions should be renamed: GetPropertyLong, GetPropertyDbl. Why do they have the same name?

I don't understand why they have different names. I use this one.

this.SetProperty(OBJPROP_XSIZE, (int)CHARTOBJECT::GetProperty(CHART_WIDTH_IN_PIXELS)); // Ширина объекта по оси X в пикселях
this.SetProperty(OBJPROP_YSIZE, (int)CHARTOBJECT::GetProperty(CHART_HEIGHT_IN_PIXELS)); // Ширина объекта по оси Y в пикселях

this.SetProperty(OBJPROP_DATE_SCALE, false); // Признак отображения шкалы времени для объекта "График"

this.SetProperty(OBJPROP_BACK, false); // Объект на заднем плане

this.SetProperty(CHART_AUTOSCROLL, false); // Режим автоматического перехода к правому краю графика
this.SetProperty(CHART_SHIFT, false); // Режим отступа ценового графика от правого края

this.SetProperty(CHART_SHOW_OHLC, false); // Отображение в левом верхнем углу значений OHLC
this.SetProperty(CHART_SHOW_PERIOD_SEP, false); // Отображение вертикальных разделителей между соседними периодами
this.SetProperty(CHART_SHOW_VOLUMES, CHART_VOLUME_HIDE); // Отображение объемов на графике
this.SetProperty(CHART_SHOW_TRADE_LEVELS, false); // Отображение на графике торговых уровней (уровни открытых позиций, Stop Loss, Take Profit и отложенных ордеров)  

this.SetProperty(CHART_MODE, CHART_LINE); // Тип графика (свечи, бары или линия)
this.SetProperty(CHART_COLOR_CHART_LINE, clrNONE); // Цвет линии графика и японских свечей "Доджи"

this.SetProperty(CHART_SCALEFIX, true); // Цвет линии графика и японских свечей "Доджи"

this.SetProperty(CHART_FIXED_MAX, 1.5); // Фиксированный максимум графика
this.SetProperty(CHART_FIXED_MIN, 1.0); // Фиксированный минимум графика

In the future, the developers promised to modify function templates so that they could call this way: GetProperty<long>(...) But you can't make a template virtual.

I don't understand the example.

I would be glad to listen to your (and other competent forum users') critics (in all seriousness) on architectural stylistics and programmer's tone to my code. I'll post it in kodobase, as soon as I finish it. It's never a shame to learn.

 
When you try to delete an indicator, Expert Advisor or script from the "Navigator" window, MT4 asks you to confirm the deletion. So, no matter what you are trying to delete (indicator, EA or script), the question text does not change.

The universal question "Remove EA?"

MT4 Build 1010 (19 Aug 2016)

Reason: