Page MenuHomeFeedback Tracker

There is no way to address parent directory with #include
Closed, ResolvedPublic



To move to parent directory use '..' (two dots):

  #include "..\codestrip.txt"

But this doesn't really work.


Legacy ID

Event Timeline

sms edited Steps To Reproduce. (Show Details)Jun 18 2013, 8:53 AM
sms edited Additional Information. (Show Details)
sms set Category to Scripting.
sms set Reproducibility to Always.
sms set Severity to None.
sms set Resolution to Fixed.
sms set Legacy ID to 2338016634.May 7 2016, 2:38 PM
sms edited a custom field.

Are there any plans to improve this?

Kumeda added a subscriber: Kumeda.May 7 2016, 2:38 PM

The last time i tried it still didnt work... that's kind of annyoing as you can't create a proper filestructure. You either have to put all functions in the parent folder or you have to duplicate the files you want to include. Neither of them is very satisfying.-> makes programming less fun!

sms added a subscriber: sms.May 7 2016, 2:38 PM
sms added a comment.Jun 17 2014, 4:53 PM

I've attatched a mission accessing absolute path "res\mydefines.hpp" via #include directive (see mycode\fn_test.sqf) - this will crash the game. This same mission calls preprocessFile "res\mydefines.hpp" (see init.sqf) and it works just fine. It would be nice if #include (when failed to find a file starting from current folder) will try to find the file starting from mission root.

No official response on something so simple? Why has this not been addressed in some manner yet? Seems so simple...

I've been using preprocessFileLineNumbers as a workaround, but it just seems like this should be working.

Duplicating the files isn't realy a option if you going to use the includes for configuration by the user. I find this very frustrating too.