CDictionary - MetaTrader 5 Library | MT5 EA Download - MetaTrader 5 Resources
Implementation of dictionary (associative array) data structure in MQL5, based on CArray objects and lists .
Dictionary *dict= new CDictionary(); //Environment dictionary.Set <string> ( "Co-starring" , "Liquid" ); Dictionary.Set <Double> ( "liquid" , 0.1 ); //Get - variant 1 string variant 1 = dict.Get <string> ( "co-starring" ); print (variant 1); //get-variant 2 double variant 2=0; Dictionary.Get <Double> ( "liquid" , variant 2); print (variant 2);
It can also store pointers to objects (but not objects or structures):
dict.Set( "purpose" , new CObject());
Attachment download
📎dict3.mq5 (3.48 KB)
📎 dictionary.mqh (15.03 KB)
Source: MQL5 #19314
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •