How to include from a different folder
#1

Hi,
I added a HTTP function to my script, which works fine, however as my server is hosted on serverffs and there is no "pawno/include" directory, I need to upload it to another "include" folder which exists...
How can I use an include of another directory?
Example: main folder named: server

so how to include server/include/a_http.inc


Thanks for you help.
Reply
#2

Just with #include since includes get copied in the script when compiling.
Reply
#3

Well it depends on where pawno.exe is located, if it's located in server/pawno then you can do:

pawn Код:
#include "../include/a_http.inc"
If it's not, then you'll have to write the full path of the include into the script.

Keep in mind that you don't need includes for the server, you only need them when compiling the script.
Reply
#4

well I want to include from server/include
so would the ../include/a_http.inc
get that folder?
Reply
#5

pawn Код:
#include "../include/a_http.inc"
That way indeed
Reply
#6

Quote:
Originally Posted by Sascha
Посмотреть сообщение
well I want to include from server/include
so would the ../include/a_http.inc
get that folder?
Only if pawno.exe is located in a sub-directory in the same folder, like I said.
Reply
#7

Why would you need to store includes on the server? They are required only when compiling, not at run-time
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)