What I am trying to do is:
#define SAMPLE_DOCS_ROOT "C:\SampleDocuments\"
#if CLIENT != ""
#define SAMPLE_DOCS_CLIENT SAMPLE_DOCS_ROOT + "client\" + CLIENT
#ifexist SAMPLE_DOCS_CLIENT
#define SAMPLE_DOCS_PATH SAMPLE_DOCS_CLIENT + "\*"
#endif
#endif
SAMPLE_DOCS_PATH never gets defined even though there is SAMPLE_DOCS_CLIENT folder.
It seems that the #ifexist
ISPP directive does not accept absolute nor relative directory path, and only accepts file paths. Is there a way to check for the presence of a directory at compile time?
You need to use the DirExists
function. The #ifexist
directive can be used only for files. So write this instead:
#define SAMPLE_DOCS_ROOT "C:\SampleDocuments\"
#if CLIENT != ""
#define SAMPLE_DOCS_CLIENT SAMPLE_DOCS_ROOT + "client\" + CLIENT
#if DirExists(SAMPLE_DOCS_CLIENT)
#define SAMPLE_DOCS_PATH SAMPLE_DOCS_CLIENT + "\*"
#endif
#endif
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments