Errores, fallos, preguntas - página 2955

 

¿Qué hacer? El empaquetado y desempaquetado de datos no funciona correctamente:

Esta es una prueba

void OnStart()
  {
   uchar my_array_in[];
   uchar my_array_out[];
   uchar my_array_test[];
   const uchar key[]= {0,0,0,0};

   for(int i1=0; i1<100; i1++)
     {
      int size=777+i1*1024+i1*3+i1;
      ArrayResize(my_array_in,size);
      for(int i2=0; i2<size; i2++)
        {
         my_array_in[i2]=uchar(i2*5956);
        }
      ResetLastError();
      int size_out=CryptEncode(CRYPT_ARCH_ZIP,my_array_in,key,my_array_out);
      if(size_out==0)
        {
         Print("CryptEncode: индекс ",i1,"   ошибка ","  ",GetLastError());
         continue;
        }
      ArrayResize(my_array_out,size_out);
      ResetLastError();
      int size_test=CryptDecode(CRYPT_ARCH_ZIP,my_array_out,key,my_array_test);
      if(size_test==0)
        {
         Print("CryptDecode: индекс ",i1,"   ошибка ","  ",GetLastError());
        }
      else
         if(size_test!=size)
           {
            Print("CryptDecode: индекс ",i1,"   не верный размер");
           }
         else
           {
            for(int i2=0; i2<size; i2++)
              {
               if(my_array_in[i2]!=my_array_test[i2])
                 {
                  Print("CryptDecode: индекс ",i1,"   ошибка в данных");
                  break;
                 }
              }
           }
     }
  }

Resultado. 4001 Error interno inesperado

2021.02.08 16:37:05.648 Test4 (EURUSD,M1)       CryptDecode: индекс 66   ошибка   4001
2021.02.08 16:37:05.649 Test4 (EURUSD,M1)       CryptDecode: индекс 68   ошибка   4001
2021.02.08 16:37:05.650 Test4 (EURUSD,M1)       CryptDecode: индекс 70   ошибка   4001
2021.02.08 16:37:05.650 Test4 (EURUSD,M1)       CryptDecode: индекс 72   ошибка   4001
2021.02.08 16:37:05.651 Test4 (EURUSD,M1)       CryptDecode: индекс 74   ошибка   4001
2021.02.08 16:37:05.652 Test4 (EURUSD,M1)       CryptDecode: индекс 76   ошибка   4001
2021.02.08 16:37:05.653 Test4 (EURUSD,M1)       CryptDecode: индекс 78   ошибка   4001
2021.02.08 16:37:05.654 Test4 (EURUSD,M1)       CryptDecode: индекс 80   ошибка   4001
2021.02.08 16:37:05.655 Test4 (EURUSD,M1)       CryptDecode: индекс 82   ошибка   4001
2021.02.08 16:37:05.656 Test4 (EURUSD,M1)       CryptDecode: индекс 84   ошибка   4001
2021.02.08 16:37:05.657 Test4 (EURUSD,M1)       CryptDecode: индекс 86   ошибка   4001
2021.02.08 16:37:05.658 Test4 (EURUSD,M1)       CryptDecode: индекс 88   ошибка   4001
2021.02.08 16:37:05.659 Test4 (EURUSD,M1)       CryptDecode: индекс 90   ошибка   4001
2021.02.08 16:37:05.660 Test4 (EURUSD,M1)       CryptDecode: индекс 92   ошибка   4001
2021.02.08 16:37:05.661 Test4 (EURUSD,M1)       CryptDecode: индекс 94   ошибка   4001
2021.02.08 16:37:05.662 Test4 (EURUSD,M1)       CryptDecode: индекс 96   ошибка   4001
2021.02.08 16:37:05.663 Test4 (EURUSD,M1)       CryptDecode: индекс 98   ошибка   4001
Por favor, que los desarrolladores resuelvan este problema
 
DMITRII PECHERITSA:

En el caso general, ambos son inadecuados, porque los métodos son virtuales y en la clase derivada, el método es anulado y ya está ocupado por otra cosa.

Y en algunos casos especiales, se puede prescindir por completo de las clases

 
#property copyright "Copyright 2021, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"

ushort a;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   a=0;
//---
   return(INIT_SUCCEEDED);
  }


No se ha podido evaluar la expresión

¿Por qué no se puede ver la variable?

Открой новые возможности в MetaTrader 5 с сообществом и сервисами MQL5
Открой новые возможности в MetaTrader 5 с сообществом и сервисами MQL5
  • 2021.02.08
  • www.mql5.com
MQL5: язык торговых стратегий для MetaTrader 5, позволяет писать собственные торговые роботы, технические индикаторы, скрипты и библиотеки функций
Archivos adjuntos:
5555.png  128 kb
 
Борис Крутов:


No se ha podido evaluar la expresión

¿Por qué no se puede ver la variable?

Creo que se debe a la agresividad a la hora de recortar las variables innecesarias (vacías, no utilizadas).

Ejemplo:

//+------------------------------------------------------------------+
//|                                                     Expert 1.mq5 |
//|                        Copyright 2021, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
//--- input parameters
input int   Input1= 9;
//---
ushort   ushort_d = 19;
uint     uint_d   = 119;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   ushort_d=8;
   uint_d=GetTickCount();
   int d=9;
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
  }
//+------------------------------------------------------------------+

Podemos ver que'ushort_d' no se calcula y no se utiliza mientras que'uint_d' al menos se calcula:


Archivos adjuntos:
Expert_1.mq5  2 kb
 

Probablemente no aquí.

Navegar por las páginas del foro y marcar las páginas vistas (cambiar el tipo de letra de negrita a normal) no funciona desde el navegador del teléfono y navegar después en el ordenador. En el teléfono cuando se navega más tarde funciona bien.

En los ordenadores de diferentes direcciones, al iniciar la sesión todo es normal. Ver en casa, en el pueblo, y luego en la oficina)))

En los ordenadores vin7, chrome. He iniciado la sesión en el sitio, chrome también está conectado a la misma cuenta.

En mi teléfono android 6 con Apex launcher y el mismo chrome. El sitio está conectado, Chrome también está conectado a la misma cuenta que en los ordenadores.

 
Vladimir Karputov:

Creo que por el recorte agresivo de variables innecesarias (vacías, no utilizadas).

Ejemplo:

Vemos que'ushort_d' no se calcula y no se utiliza, mientras que'uint_d' al menos se calcula:


***

Tampoco funciona así. Y si cambiamos 'ushort a int', el programador ve la variable

Открой новые возможности в MetaTrader 5 с сообществом и сервисами MQL5
Открой новые возможности в MetaTrader 5 с сообществом и сервисами MQL5
  • 2021.02.09
  • www.mql5.com
MQL5: язык торговых стратегий для MetaTrader 5, позволяет писать собственные торговые роботы, технические индикаторы, скрипты и библиотеки функций
 
Boris:

***

Esto tampoco funciona. Y si cambias ushort por int, ve la variable

Introduzca el código correctamente (utilice el botón Código).

 
Vladimir Karputov:

Introduzca el código correctamente (utilice el botón ).

#property copyright "Copyright 2021, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"



ushort=GetTickCount64();
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
a=GetTickCount64();
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
  a=a++;
  Comment("a: ",a,"/n");
}
Исправил
 
Boris:

El código no compila debido a un gran número de errores. Arregla el código.

 
#property copyright "Copyright 2021, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"



ushort a;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
a=(ushort)GetTickCount();
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
  a++;
  Comment("a: ",a,"/n");
}
Vladimir Karputov:

El código no compila debido a un gran número de errores. Arregla el código.

Fijado por