MetaTrader 4 Client Terminal build 610 - страница 44

 
Zhunko:

Метаквоты, поясните, пожалуйста! Есть такая структура:

1. szString дополняется нуль-терминатором?

2. Если дополняется, то, что определяет nLength? Длину буфера с нуль-терминатором или без?

Вадим, это откуда? Вроде не видел в MQL4 таких типов LPWSTR, они вроде как в С++ присутствуют.
 
Barbarian:
Вадим, это откуда? Вроде не видел в MQL4 таких типов LPWSTR, они вроде как в С++ присутствуют.
Это структура строки в MQL-массиве строк. Она нужна в коде С++.
 
Zhunko:
Это структура строки в MQL-массиве строк. Она нужна в коде С++.

А как MQL4 понимает LPWSTR ? Ведь в С++ это константный указатель long на строку Unicode, а в MQL4 указателей как в С++ нет.
 

Ставила вопрос в др. ветке. Но поскольку никто из старожилов не знает ответа, просьба ответить разработчиков.

После обновления перестал работать индикатор. Окно индикатора отображается пустое и в журнале появляется надпись:

Что это означает?

 
Barbarian:
А как MQL4 понимает LPWSTR ? Ведь в С++ это константный указатель long на строку Unicode, а в MQL4 указателей как в С++ нет.

Прям, не знаю, что сказать... :-)) Никаких противоречий нет. Так сделано.

Rita:

Ставила вопрос в др. ветке. Но поскольку никто из старожилов не знает ответа, просьба ответить разработчиков.

После обновления перестал работать индикатор. Окно индикатора отображается пустое и в журнале появляется надпись:

Что это означает?

Нарушение прав доступа для чтения к 0x000003E5 в ...
Наверно, кривой индикатор. Кода нет. Вот никто не отвечает.
 

Хм. Получается, что логическая конструкция из 509 билда типа if (A && B && C || D && E && F) будет эквивалентна if (((A && B && C) || D) && E && F) в 600 билде.

 
Zhunko:

Прям, не знаю,.....

Нарушение прав доступа для чтения к 0x000003E5 в ...
Наверно, кривой индикатор. Кода нет. Вот никто не отвечает.

Мне не понятно, что означает "нарушение прав доступа для чтения к .... ?????"

Может быть разработчики все же ответят, - в каких случаях обновленный мт4 с сервера возвращает этот ответ? Чьи права нарушены?

Access violation read to 0x000003E5 in 'C:\Program Files\InstaTrader\MQL4\indicators\Spr

 
RickD:

Хм. Получается, что логическая конструкция из 509 билда типа if (A && B && C || D && E && F) будет эквивалентна if (((A && B && C) || D) && E && F) в 600 билде.

Утверждать, что условия эквивалентны не буду, потому как и в 509м не применял условий без скобок, но суть такая, что в старом языке условие проверялось полностью, а в новом так-же как в С++ и даже в васике.

В твоём примере сначала будет проверено (A && B && C) и если условие выполнено, то условие D проверяться не будет, а перейдёт к проверке условия E и только если оно выполнено, будет проверено условие F. В случае если условие А не будет выполнено, то проверка минуя условия В и С перейдёт к проверке условия D и продолжится только если оно будет выполнено.

 

Проверьте плиз команду

//--- удален объект
if(id==CHARTEVENT_OBJECT_DELETE)
{
Print("Удален объект с именем ",sparam);
}

кажется она не работает

 

К вопросу "о стилях", может есть возможность расширить список?

По умолчанию, их не так уж и много, всего дюжина

Bracket Style Options

Bracket Style options define the bracket style to use. This option always overrides any individual option settings. 
You will always get the requested style regardless of other defined options.

All other options are available to customize the bracket style. By default, none of the styles indent namespaces. 
All options default to 4 spaces per indent, indented with spaces.

 

default bracket style
If no bracket style option is set, the opening brackets will not be changed and closing brackets will be broken from the preceding line.

 

--style=allman / --style=ansi / --style=bsd / --style=break / -A1
Allman style formatting/indenting uses broken brackets.

int Foo(bool isBar)
{
    if (isBar)
    {
        bar();
        return 1;
    }
    else
        return 0;
}        
 

--style=java / --style=attach / -A2
Java style formatting/indenting uses attached brackets.

int Foo(bool isBar) {
    if (isBar) {
        bar();
        return 1;
    } else
        return 0;
}
 

--style=kr / --style=k&r / --style=k/r / -A3
Kernighan & Ritchie style formatting/indenting uses linux brackets. Brackets are broken from namespaces, classes, and function definitions. 
Brackets are attached to statements within a function.

Using the k&r option may cause problems because of the &. 
This can be resolved by enclosing the k&r in quotes (e.g. ‑‑style="k&r") or by using one of the alternates ‑‑style=kr or ‑‑style=k/r.

int Foo(bool isBar) 
{
    if (isBar) {
        bar();
        return 1;
    } else
        return 0;
}
 

--style=stroustrup / -A4
Stroustrup style formatting/indenting uses stroustrup brackets. Brackets are broken from function definitions only. 
Brackets are attached to namespaces, classes, and statements within a function. This style frequently is used with an indent of 5 spaces.

int Foo(bool isBar) 
{
     if (isBar) {
          bar();
          return 1;
     } else
          return 0;
}
 

--style=whitesmith / -A5
Whitesmith style formatting/indenting uses broken, indented brackets. Class blocks and switch blocks are indented 
to prevent a 'hanging indent' with switch statements and C++ class modifiers (public, private, protected). 

int Foo(bool isBar) 
    {
    if (isBar)
        {
        bar();
        return 1;
        }
    else
        return 0;
    }
 

--style=banner / -A6
Banner style formatting/indenting uses attached, indented brackets. Class blocks and switch blocks are indented 
to prevent a 'hanging indent' with switch statements and C++ class modifiers (public, private, protected). 

int Foo(bool isBar) {
    if (isBar) {
        bar();
        return 1;
        }
    else
        return 0;
    }
 

--style=gnu / -A7
GNU style formatting/indenting uses broken brackets and indented blocks. This style frequently is used with an indent of 2 spaces.

Extra indentation is added to blocks within a function. The opening bracket for namespaces, classes, and functions is not indented.

int Foo(bool isBar)
{
  if (isBar)
    {
      bar();
      return 1;
    }
  else
    return 0;
}
 

--style=linux / -A8
Linux style formatting/indenting uses linux brackets. Brackets are broken from namespace, class, and function definitions. 
Brackets are attached to statements within a function. Minimum conditional indent is one-half indent. 
If you want a different minimum conditional indent use the K&R style instead. This style works best with a large indent. 
It frequently is used with an indent of 8 spaces.

Also known as Kernel Normal Form (KNF) style, this is the style used in the Linux kernel.

int Foo(bool isBar)
{
        if (isFoo) {
                bar();
                return 1;
        } else
                return 0;
}
 

--style=horstmann / -A9
Horstmann style formatting/indenting uses run-in brackets, brackets are broken and allow run-in statements. 
Switches are indented to allow a run-in to the opening switch block. This style frequently is used with an indent of 3 spaces.

int Foo(bool isBar)
{  if (isBar)
   {  bar();
      return 1;
   } else
      return 0;
}
 

--style=1tbs / --style=otbs / -A10
"One True Brace Style" formatting/indenting uses linux brackets and adds brackets to unbracketed one line conditional statements. 
In the following example brackets have been added to the "return 0;" statement. 
The option ‑‑add‑one‑line‑brackets can also be used with this style.

int Foo(bool isBar)
{
    if (isFoo) {
        bar();
        return 1;
    } else {
        return 0;
    }
}
 

--style=pico / -A11
Pico style formatting/indenting uses run-in brackets, opening brackets are broken and allow run-in statements. 
The closing bracket is attached to the last line in the block. Switches are indented to allow a run-in to the opening switch block. 
The style implies keep-one-line-blocks and keep-one-line-statements. This style does not support multiple-line brackets. 
If add-brackets is used they will be added as one-line brackets. This style frequently is used with an indent of 2 spaces.

int Foo(bool isBar)
{  if (isBar)
   {  bar();
      return 1; }    
    else
      return 0; }
 

--style=lisp / --style=python / -A12
Lisp style formatting/indenting uses attached brackets, opening brackets are attached at the end of the statement. 
The closing bracket is attached to the last line in the block. The style implies keep-one-line-statements but NOT keep-one-line-blocks. 
This style does not support one-line brackets. If add-one-line-brackets is used they will be added as multiple-line brackets.

int Foo(bool isBar) {
    if (isBar) {
        bar()
        return 1; }
    else
        return 0; }
 


Причина обращения: