InvestSocial
Reply to thread
Results 1 to 1 of 1

Thread: How MQL4 handles files programmatically? part 2

  1. #1 You can automatically minimize the read posts in your account in the 'Forum Settings'
    My pips hand is weak
    I am:
    ----
     
    Somia2020 is on a distinguished road Somia2020's Avatar
    Join Date
    Oct 2020
    Posts
    123
    Accumulated bonus
    69 USD (What is this?)
    Thanks
    0
    Thanked 253 Times in 61 Posts
    SubscribeSubscribe
    Subsribed 0

    Post How MQL4 handles files programmatically? part 2

    Name: 1.png Views: 43 Size: 135.7 KB

    FileReadArray
    FileWriteArray


    The first function writes the contents of an array to the open file, which should be the type's open file
    Binary and not a text file.

    With this function, we can save the contents of a vital matrix to ensure that critical information is not lost when stopping the program for any reason.

    The second function is to retrieve the contents of this array again from the binary file when the program is restarted again.


    FileWriteDouble
    FileReadDouble


    The first function writes a double numeric value to the binary file.

    The second function is to read the digital value from the binary file.

    FileWriteInteger
    FileReadInteger

    The first function writes an integer numeric value to the binary file.

    The second function is to read the digital value from the binary file.


    The previous four functions save the numbers in the file in binary format, which means that when you open the file in Notepad, you will not see the numbers appearing or clear in front of you.


    FileReadNumber

    This function reads a number written in a text file and not a number in binary format.

    FileWriteString
    FileReadString


    The first function writes a string value to the binary file.

    The second function is to read the text value from the binary file.

    FileSeek

    This function changes the location of the opened file's pointer.
    The pointer works must be well understood.

    When the file is opened, the pointer is at byte number 1 of the open file.
    When reading any text or numerical value from the file, the pointer moves automatically to the read's last byte.

    It is possible at any time to change the pointer site to the place we want, and this feature must be handled with caution because it may lead to incorrectly reading or writing the information on the file.


    FileSize

    This function returns the current file size in bytes.


    FileTell

    This function informs us of the current file's pointer location, and it works the opposite of the FileSeek position.


    FileWrite

    This function writes text information to the text file only.

    Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.


  2. The Following User Says Thank You to Somia2020 For This Useful Post:

    ghada1996 (07-02-2021)

Reply to thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts