Initial commit: MQL5 Scripts Collection (MetaTrader 5)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# 🚀 Unlock the Power of Trading!
|
||||
|
||||
Welcome to this open-source trading project. Here you will find powerful tools to enhance your trading journey. If you find this project useful, please consider starring ⭐, sharing, or donating to support further development!
|
||||
|
||||
---
|
||||
|
||||
**Support the project:**
|
||||
- Star this repository on GitHub
|
||||
- Share it with your trading friends
|
||||
- [Donate here](https://www.paypal.com/donate/?hosted_button_id=YOUR_BUTTON_ID) to help us grow!
|
||||
|
||||
---
|
||||

|
||||
|
||||
## Source Files
|
||||
- `demo_filefindfirst.mq5`
|
||||
|
||||
---
|
||||
> Made with ❤️ for the trading community.
|
||||
@@ -0,0 +1,41 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| Demo_FileFindFirst.mq5 |
|
||||
//| Copyright 2013, MetaQuotes Software Corp. |
|
||||
//| http://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "Copyright 2013, MetaQuotes Software Corp."
|
||||
#property link "http://www.mql5.com"
|
||||
#property version "1.00"
|
||||
//--- display the window of input parameters when launching the script
|
||||
#property script_show_inputs
|
||||
//--- filter
|
||||
input string InpFilter="*";
|
||||
//+------------------------------------------------------------------+
|
||||
//| Script program start function |
|
||||
//+------------------------------------------------------------------+
|
||||
void OnStart()
|
||||
{
|
||||
string file_name;
|
||||
int i=1;
|
||||
//--- receive search handle in local folder's root
|
||||
long search_handle=FileFindFirst(InpFilter,file_name);
|
||||
//--- check if FileFindFirst() function executed successfully
|
||||
if(search_handle!=INVALID_HANDLE)
|
||||
{
|
||||
//--- check if the passed strings are file or directory names in the loop
|
||||
do
|
||||
{
|
||||
ResetLastError();
|
||||
//--- if this is a file, the function will return true, if it is a directory, the function will generate error 5018
|
||||
FileIsExist(file_name);
|
||||
PrintFormat("%d : %s name = %s",i,GetLastError()==5018 ? "Directory" : "File",file_name);
|
||||
i++;
|
||||
}
|
||||
while(FileFindNext(search_handle,file_name));
|
||||
//--- close search handle
|
||||
FileFindClose(search_handle);
|
||||
}
|
||||
else
|
||||
Print("Files not found!");
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
Reference in New Issue
Block a user