Warning: file_put_contents(/ff_7131414ae85a45226bbc3e6007eb6c0e5bf9d67a6ef20002.php): failed to open stream: Permission denied in /home/ofpecsav/public_html/forum/Sources/Subs-ForumFirewall.php on line 1619
preprocessFile - OFPEC Scripting Command Reference | OFPEC The Editing Center

preprocessFile filename

Operand types

filename: String

Type of returned value


Returns preprocessed content of given file.
Preprocessor is C-like, supports comments using // or /* and */ and macros defined with #define.

Usually used in conjunction with compile, in order to create a function from an sqf script file.

Note that any error message generated by the function will not give file-name or line number information. If using ArmA, it is therefore preferable to always use preprocessFileLineNumbers instead of this command.

Used In



// Pre-compile a function.
myFunction = compile preprocessFile "myFunction.sqf";

// Call the function later.
_result = [_param1, _param2, _param3] call myFunction;