FileSet Test

Author: Copyright 2021, MetaQuotes Ltd.
Price Data Components
Series array that contains open prices of each barSeries array that contains close prices for each bar
0 Views
0 Downloads
0 Favorites
FileSet Test
//+------------------------------------------------------------------+
//|                                                 FileSet Test.mq5 |
//|                                  Copyright 2021, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"

#include <Files\FileSet.mqh>

enum ENUM_TEST
  {
   TEST1=0,
   TEST2=17,
   TEST3=89,
  };

CFileSet FileSet;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   FileSet.Open("Test.set",FILE_READ|FILE_SHARE_READ);
   char test_char;
   if(FileSet.TryGetValue("InpTestChar",test_char))
      Print(test_char);
   short test_short;
   if(FileSet.TryGetValue("InpTestShort",test_short))
      Print(test_short);
   int test_int;
   if(FileSet.TryGetValue("InpTestInteger",test_int))
      Print(test_int);
   long test_long;
   if(FileSet.TryGetValue("InpTestLong",test_long))
      Print(test_long);
   float test_float;
   if(FileSet.TryGetValue("InpTestFloat",test_float))
      Print(test_float);
   double test_double;
   if(FileSet.TryGetValue("InpTestDouble",test_double))
      Print(test_double);
   string test_string;
   if(FileSet.TryGetValue("InpTestString",test_string))
      Print(test_string);
   bool test_bool;
   if(FileSet.TryGetValue("InpTestBool",test_bool))
      Print(test_bool);
   datetime test_datetime;
   if(FileSet.TryGetValue("InpTestDatetime",test_datetime))
      Print(TimeToString(test_datetime,TIME_DATE|TIME_SECONDS));
   color test_color;
   if(FileSet.TryGetValue("InpTestColor",test_color))
      Print(ColorToString(test_color,true));
   ENUM_TEST test_enum;
   if(FileSet.TryGetValue("InpTestEnum",test_enum))
      Print(EnumToString(test_enum));
   FileSet.Close();
  }
//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---