remove the string from the structure, it will work
Either you copy element by element, every variable in the structure or replace the string with a static array uchar[16];
which string do you want to remove?
I actually went to the reference book to see an example, to understand how to copy a variable of structure type to another variable of the same structure type... And what happens to the functions that are declared in them. Copying element by element is not good... ...it makes a very long drag.
As a matter of fact, I've used the reference book to see an example, to understand how a variable of structure type can be copied into another variable of the same structure type... And what happens to the functions that are declared in them. Copying element by element is not good... ...it just turns out to be a very long drag.
We are talking about structured data. You mean a variable of the structure type to be represented as an array??? :-))) Not an option either... There are functions in the structure that if you declare them separately, there will be even more confusion.
As a matter of fact, I've used the reference book to see an example, to understand how a variable of structure type can be copied into another variable of the same structure type... And what happens to the functions that are declared in them. Copying element by element is not good... ...it's a very long drag.
Yes, sorry, I misread that advice...
As far as I remember, a new union type has now been introduced and you should do something like this:
#property script_show_inputs#define red colir[0]
#define green colir[1]
#define blue colir[2]
inputcolor testColor=clrBlue;// задайте цвет для тестирования//--- структура для представления цвета в RGBunion RGB
{
color cvet;
uchar colir[4];
string toString(); // функция для получения в виде строки
};
//--- функция для вывода цвета в виде строкиstring RGB::toString(void)
{
string out="("+(string)red+":"+(string)green+":"+(string)blue+")";
return out;
}
//+------------------------------------------------------------------+//| Script program start function |//+------------------------------------------------------------------+voidOnStart()
{
//--- переменная для хранения в RGB
RGB colorRGB;
colorRGB.cvet=testColor;
Print("color ",colorRGB.cvet," = ",colorRGB.toString());
//---
}
Good afternoon. Please clarify why it does not show the correct information.
//+------------------------------------------------------------------+//---- indicator buffersdouble AO[]; // массив для индикатора iAO//---- handles for indicatorsint AO_handle; // указатель на индикатор iAO//+------------------------------------------------------------------+//| Expert initialization function |//+------------------------------------------------------------------+intOnInit()
{
//--- создание указателя на объект - индикатор iAO
AO_handle=iAO(NULL,0);
//--- если произошла ошибка при создании объекта, то выводим сообщениеif(AO_handle<0)
{
Print("Объект iAO не создан: Ошибка исполнения = ",GetLastError());
//--- принудительное завершение программыreturn(-1);
}
return(0);
}
//+------------------------------------------------------------------+//| |//+------------------------------------------------------------------+voidOnDeinit(constint reason)
{
ArrayFree(AO);
}
//+------------------------------------------------------------------+//| Expert tick function |//+------------------------------------------------------------------+voidOnTick()
{
//--- Достаточно ли количество баров для работыif(Bars(_Symbol,_Period)<10) // общее количество баров на графике меньше 10?
{
Alert("На графике меньше 10 баров, советник не будет работать!!");
return;
}
ArraySetAsSeries(AO,true);
//--- заполнение массива AO[] текущими значениями индикатора iAO//--- задаём порядок индексации массива как в таймсерии//--- если произошла ошибка, то прекращаем выполнение дальнейших операций;if(CopyBuffer(AO_handle,0,0,100,AO)<=0)return;
double AO_1=AO[1];
AO_1=NormalizeDouble(AO_1,7);
Print("AO=",AO_1);
double AO_2=AO[2];
AO_2=NormalizeDouble(AO_2,7);
Print("AO2=",AO_2);
}
//+------------------------------------------------------------------+
I got it from the code, sorry - I'll take it into account in the future
negative value is displayed incorrectly. this may be due to the double type
let me clarify a question - how to make a negative value to be displayed correctly and whether it can be normalized like a positive value (which is displayed correctly)
I got it from the code, sorry - I'll take it into account in the future
The negative value is displayed incorrectly. It must be because of the double type.
I'll clarify the question - how to make a negative value be displayed correctly and whether it can be normalised like a positive value (which is displayed correctly)
When I was a kid, when I dabbled with a calculator, I used to get the same kind of E's. After I started programming I remembered my calculator and everything went back to normal.
Try converting it to a string if you want to see the number in a string.
remove the string from the structure, it will work
or copy element by element, every variable in the structure
or replace the string with a static array uchar[16];
remove the string from the structure, it will work
Either you copy element by element, every variable in the structure
or replace the string with a static array uchar[16];
which string do you want to remove?
I actually went to the reference book to see an example, to understand how to copy a variable of structure type to another variable of the same structure type... And what happens to the functions that are declared in them. Copying element by element is not good... ...it makes a very long drag.
which string to remove?
As a matter of fact, I've used the reference book to see an example, to understand how a variable of structure type can be copied into another variable of the same structure type... And what happens to the functions that are declared in them. Copying element by element is not good... ...it just turns out to be a very long drag.
Have you triedArrayCopy?
Have you tried ArrayCopy?
We are talking about structured data. You mean a variable of the structure type to be represented as an array??? :-))) Not an option either... There are functions in the structure that if you declare them separately, there will be even more confusion.
Although it is easier to use ColorToString(testColor)
If you want to use data conversion, use ServiceDesk. The error you mentioned is also present in MetaEditor in MT5
which string to remove?
As a matter of fact, I've used the reference book to see an example, to understand how a variable of structure type can be copied into another variable of the same structure type... And what happens to the functions that are declared in them. Copying element by element is not good... ...it's a very long drag.
Yes, sorry, I misread that advice...
As far as I remember, a new union type has now been introduced and you should do something like this:
Good afternoon. Please clarify why it does not show the correct information.
Hi. Could you please tell me why it does not give the right information?
Where did you see incorrect information?
And, please, insert the code correctly (I corrected in your post)
Posted in red rectangle:
I got it from the code, sorry - I'll take it into account in the future
negative value is displayed incorrectly. this may be due to the double type
let me clarify a question - how to make a negative value to be displayed correctly and whether it can be normalized like a positive value (which is displayed correctly)
I got it from the code, sorry - I'll take it into account in the future
The negative value is displayed incorrectly. It must be because of the double type.
I'll clarify the question - how to make a negative value be displayed correctly and whether it can be normalised like a positive value (which is displayed correctly)
When I was a kid, when I dabbled with a calculator, I used to get the same kind of E's. After I started programming I remembered my calculator and everything went back to normal.
Try converting it to a string if you want to see the number in a string.