거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Facebook에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
조회수:
4097
평가:
(28)
게시됨:
2013.03.29 11:55
업데이트됨:
2016.11.22 07:32
\MQL5\Files\Data\
file.txt (0.1 KB) 조회
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

The script reads and prints data from a file which is located in the terminal local folder. Reading performs in the loop by the FileReadString() function until the end of the file. The FileIsEnding() function is used to check, if the end of the file is reached.

It should be noted that to define the end of the file, the function tries to read the next string from the file. If it doesn't exist, the function will return true, otherwise it will return false.

Code:

//--- show the window of input parameters when launching the script
#property script_show_inputs
//--- input parameters
input string InpFileName="file.txt";    // file name
input string InpDirectoryName="Data";   // directory name
input int    InpEncodingType=FILE_ANSI; // ANSI=32 or UNICODE=64
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- print the path to the file we are going to use
   PrintFormat("Working %s\\Files\\ folder",TerminalInfoString(TERMINAL_DATA_PATH));
//--- reset the error value
   ResetLastError();
//--- open the file for reading (if the file does not exist, the error will occur)
   int file_handle=FileOpen(InpDirectoryName+"//"+InpFileName,FILE_READ|FILE_TXT|InpEncodingType);
   if(file_handle!=INVALID_HANDLE)
     {
      //--- print the file contents
      while(!FileIsEnding(file_handle))
         Print(FileReadString(file_handle));
      //--- close the file
      FileClose(file_handle);
     }
   else
      PrintFormat("Error, code = %d",GetLastError());
  }

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/1617

i-IntradayFibonacci i-IntradayFibonacci

Intraday Fibonacci levels

Demo_FileFlush Demo_FileFlush

The script demonstrates the example of using the FileFlush() function

Demo_FileGetInteger Demo_FileGetInteger

The script demonstrates the example of using the FileGetInteger() function

Demo_FileWriteArray Demo_FileWriteArray

The script demonstrates the example of using the FileWriteArray() function