double quotes needed ??

Carl Schreiber
Moderator
12355
Carl Schreiber  

Hi,


I want to use "kernel32.dll" to read and write files. (from http://www.m-t-a-w.com/indicatorsandea/File%20Read%20Write.mq4)

from other than the MT4-default-folders.

So far so good.

But now I want to define the path to the files to be read or written:

#define PATH         "C:\Users\cas\Documents\MT4\myMQ4\SETs\"

But this causes this compiling error:

'C:\Users\cas\Documents\MT4\myMQ4\SETs"' - double quotes needed C:\Program Files (x86)\... ??

Interesting for me, this doe not cause a compiling error:

#define PATH         "'C:\Users\cas\Documents\MT4\myMQ4\SETs\'"

But I doubt - not tested yet, I'm not that far tu run my EA - that this will work?

Any hint how to define a path properly?

Thanks in advance and happy trading ;)

gooly

Carl Schreiber
Moderator
12355
Carl Schreiber  
gooly:

Hi,


I want to use "kernel32.dll" to read and write files. (from http://www.m-t-a-w.com/indicatorsandea/File%20Read%20Write.mq4)

from other than the MT4-default-folders.

So far so good.

But now I want to define the path to the files to be read or written:

But this causes this compiling error:

Interesting for me, this doe not cause a compiling error:

But I doubt - not tested yet, I'm not that far tu run my EA - that this will work?

Any hint how to define a path properly?

Thanks in advance and happy trading ;)

gooly




The solution is just to double the '\':

#define PATH         "C:\\Users\\cas\\Documents\\MT4\\myMQ4\SETs\\"
bernd
990
bernd  
or simply use forward slashes. Thats what I usually do. Windows has no problems interpreting the forward slashes as if they were backslashes.