Add more functions

MQL5 Libraries

Specification

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;
   }
}




Responded

1
Developer 1
Rating
(11)
Projects
16
25%
Arbitration
0
Overdue
1
6%
Free
2
Developer 2
Rating
(361)
Projects
386
70%
Arbitration
3
100% / 0%
Overdue
2
1%
Working

Project information

Budget
30+ USD
For the developer
27 USD
Deadline
from 1 to 2 day(s)