CFileSet - MetaTrader 5 Library | MT5 EA Download - MetaTrader 5 Resources
//--- Method for processing files integer open ( const string file name, constant integer open flag); //--- Methods to access protected data integer count( blank ); boolean contains key( string key); //--- Method template for accessing data < type name T value> boolean Try to get value ( const stringkey , TValue and value); boolean tryGetValue( const StringKey , String &Value);
usage
#Include <File\FileSet.mqh> CFileSet file set; //+--------------------------------------------------------------------------------+ //|Script program startup function | //+------------------------------------------------------------------+ blank start () { //--- File set. Open ( "Test set" , file reading | file sharing reading ); character test character; if (fileset.TryGetValue( "Inp test character" , test_char)) print (testchar); Short tests are short; if (fileset.TryGetValue( "Inp test short" ,test_short)) print (testshort); integer test_int; if (fileset.TryGetValue( "Inp test integer" , test_int)) print (testint); Long tests are long; if (fileset.TryGetValue( "Inp test long" ,test_long)) print (testLong); float test float; if (fileset.TryGetValue( "InpTestFloat" ,test_float)) print (testfloat); Double the test double precision; if (fileset.TryGetValue( "Inp test double" ,test_double)) print (testdouble); string test string; if (fileset.TryGetValue( "Inp test string" , test string)) print (testString); boolean test boolean; if (fileset.TryGetValue( "InpTestBool" , test_bool)) print (test boolean); datetime test datetime; if (fileset.TryGetValue( "InpTestDateTime" ,TestDateTime)) print ( String time (testDateTime, TIME_DATE | TIME_SECONDS )); color test color; if (fileset.TryGetValue( "Inp test color" , test color)) print ( colorToString (testColor, true )); ENUM_TEST test_enum; if (fileset.TryGetValue( "InpTestEnum" ,test_enum)) print ( enum to string (test enum)); FileSet.Close(); } //+------------------------------------------------------------------+ It should display the following results and sample file (Test.set) 2021.05 . 31 05 : 09 : 27.546 Fileset Test (EURUSD, H1) 97 2021.05 . 31 05 : 09 : 27.548 Fileset Test (EURUSD, H1) 32767 2021.05 . 31 05 : 09 : 27.548 File Set Test (EURUSD, H1) 2147483647 2021.05 . 31 05 : 09 : 27.548 Fileset Test (EURUSD, H1) 9223372036854775807 2021.05 . 31 05 : 09 : 27.548 Fileset Test (EURUSD, H1) 1.00001 2021.05 . 31 05 : 09 : 27.548 File Set Test (EURUSD, H1) 2.225073858507201 Electronic- 308 2021.05 . 31class="number">05: 09 : 27.548 Fileset Test (EURUSD, H1) This is InpTestString 2021.05 . 31 05 : 09 : 27.548 Fileset Test (EURUSD, H1) Error 2021.05 . 31 05 : 09 : 27.548 Fileset Test (EURUSD, H1) 2000.01 . 01 : 00 : 00 : 00 2021.05 . 31 05 : 09 : 27.548 File Set Test (EURUSD, H1) Black 2021.05 . 31 05 : 09 : 27.548 File Set Test (EURUSD, H1) TEST3
Attachment download
📎 fileset_expert.mq5 (1.92 KB)
📎 fileset_test.mq5 (2.16 KB)
📎 test.set (1.47 KB)
📎 fileset.mqh (6.1 KB)
Source: MQL5 #34962
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •