Add more functions

MQL5 Bibliotecas

Termos de Referência

Hi,


I need this code to be mod with added function of for MT5:

- delete a node with a key (array size should be reduced by 1), return bool
- check if a node exits with a key, return bool
- update a node with a key, return bool

Note:
I need key to be string
Date is double
array size is dynamic


I want to pay only $30. You need give me the code, upon  fully tested, I will release the payment to you. Also provide examples of using it


Basic code can be found here:



string DictGet(string &theArray[][],double key,int sze)
{
   key = NormalizeDouble(key,myDigits());
  
   for (int x = 0; x< (sze/2);x++)
   {
      if (theArray[x][0] == string(key)) //key exists
         return(theArray[x][1]);
   }
   return("!"); //key not found

}

void DictAdd(string &theArray[][],double key,string info,int sze)
{
   key = NormalizeDouble(key,myDigits());

   if (sze >0)
   {
      for (int x = 0; x< (sze/2);x++)
      {
         if (theArray[x][0] == string(key)) // key exits so add to string and return out
         {
            theArray[x][1] += " , "+info;
            return;
         }
      }
   }

   if (theArray[0][0] == "nil") //first key and val to add to dictionary
   {
      theArray[0][0] = string(key);
      theArray[0][1] = info;
      return;
   }
   else //new key, re-size array and add in key and val
   {
      ArrayResize(theArray,(sze/2)+1,0);
      theArray[(sze/2)][0] = string(key); //as it is a 2 dimensional array the correct index is half the size. should be half size + 1 but cuz indexing starts at 0 it is just half.
      theArray[(sze/2)][1] = info;
   }
}




Respondido

1
Desenvolvedor 1
Classificação
(11)
Projetos
16
25%
Arbitragem
0
Expirado
1
6%
Livre
2
Desenvolvedor 2
Classificação
(396)
Projetos
422
69%
Arbitragem
4
75% / 0%
Expirado
2
0%
Carregado

Informações sobre o projeto

Orçamento
30+ USD
Desenvolvedor
27 USD
Prazo
de 1 para 2 dias