Include Problem
#1

For some reason sometimes it won't include a file unless i move it to another directory.

Example:

#include "functions/players/accounts.pwn"
#include "functions/players/characters.pwn"
#include "..."
#include "functions/players/somefile.pwn"

somefile.pwn won't include unless i move it out of the directory.
Why does it happen? How can I prevent that from happening?

P.S. the file exists, its in the right directory, not included before.
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
I've lost track of how many times I've said this! Use "\" not "/"...
I usually do, but then it won't let me include more than one file with the same name (files which are in different directories).
According to the Pawn_Language_Guide.pdf I could do this:

Quote:

When the file can be opened successfully, the #include directive
defines a constant with the name “_inc_” plus the base name of
the file (the filename without path and extension) and the value 1.
If the constant already exists, the #include directive skips opening
and including the file, thus preventing a double inclusion. To force
a double include, remove the constant definition with the #undef
directive before the second inclusion of the file.

I've tried that, believe me but that won't work for me either, so I am really lost.
Reply
#3

Well the problem isn't with including multiple files with the same name, fortunately that works.

The file I'm trying to include isn't included before, it simply doesn't include it.
I'm guessing its something with the internal checks that causing it to skip this file, and it probably has something to do with the directory name, because if I move it to another directory it doesn't skip it.

After reading one of your posts (http://forum.sa-mp.com/showpost.php?...55&postcount=3)
I tried to change the last slash to a backward slash and that actually fixed the issue.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)