Need file .mqh

 
I need a mqh file that tell me with a print the current Directory where is. Is it possibile someone to write me please?
 
rom: Is it possibile someone to write me please?

You have only four choices:

  1. Search for it (CodeBase or Market). Do you expect us to do your research for you?

  2. Beg at:

  3. MT4: Learn to code it.
    MT5: Begin learning to code it.

    If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.

  4. Or pay (Freelance) someone to code it. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum (2019)

We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
          No free help (2017)

 
https://www.mql5.com/en/docs/files/filefindfirst

There is an example in the documentation.
Good luck
 
rom:
I need a mqh file that tell me with a print the current Directory where is. Is it possibile someone to write me please?

It's one line you need basically 

Print(MQLInfoString(MQL_PROGRAM_PATH)); 

To the other replies . Jesus Christ guys ... Jesus Christ 

 
Lorentzos Roussos #: It's one line you need basically To the other replies . Jesus Christ guys ... Jesus Christ 

Yes, it is just one line. However, do you really believe it will help the OP?

No, it will not help the OP at all!

The very fact that the OP is unable to come up with that single line of code and the fact that he asks for a ".mqh" file, shows that the OP understands very little about coding. In fact, we are not even sure if that is what is meant by "current directory".

So, even if it is just only line, there is very little chance that they will know what to do with it.

So, please, spare us the JC speech.

 
Fernando Carreiro #:

Yes, it is just one line. However, do you really believe it will help the OP?

No, it will not help the OP at all!

The very fact that the OP is unable to come up with that single line of code and the fact that he asks for a ".mqh" file, shows that the OP understands very little about coding. In fact, we are not even sure if that is what is meant by "current directory".

So, even if it is just only line, there is very little chance that they will know what to do with it.

So, please, spare us the JC speech.

So the OP has to .. Beg for it ?

 
rom:
I need a mqh file that tell me with a print the current Directory where is. Is it possibile someone to write me please?

Attached the mqh file - Path.mqh

Paste it under include folder and test with Path.mq5 file, Cheers! 

😚

Files:
Path.mq5  2 kb
Path.mqh  1 kb
 
Lorentzos Roussos #: So the OP has to .. Beg for it ?

Please don't resort to sophistry!

I'm not at all against you for helping users out which ever way you want. You are free to do as you wish.

You already know my own point of view on the matter just as I understand your point of view.

However, I don't agree when you consider the other posts as invalid or incorrect or even imoral, just because you don't agree with their point of view.

EDIT: I don't wish for this to get any more heated, so this is all I will say, because I consider you a good person and don't wish for any animosity between us.

 
Arpit T #:

Attached the mqh file - Path.mqh

Paste it under include folder and test with Path.mq5 file, Cheers! 

😚

Interesting adaptation , i like how you have evolved the solution .  😅  


😁

 
Arpit T #:

Attached the mqh file - Path.mqh

Paste it under include folder and test with Path.mq5 file, Cheers! 

😚

Hi, thank you! Very kind! I really appreciate your help! However, the command MQLInfoString(MQL_PROGRAM_PATH), reproduces the path where the .ex5 file is executed. What I was interested is a function that tell me the directory where the mqh file is located.

I know that this file is located in the include directory, however I need to get the path programatically. So I think I need to use some C++ function, a language that I do not know. All my attempts have failed.
 
Lorentzos Roussos #:

It's one line you need basically 

To the other replies . Jesus Christ guys ... Jesus Christ 

Thank you! Actually from the MQLInfoString(MQL_PROGRAM_PATH) function, you get the path to the .ex5 file. I need the .mqh one. I think it's a matter of implementing a C++ function on .mqh file. C++ is a  language that unfortunately I don't know.

Basically .mq5 should call the .mqh file, which should in turn execute the command as if it were a main class. But I'm afraid this cannot be done in the MT5 context, or can it?

As I already anticipated I know the .mqh path but I need to trace back to that path via code.
Reason: