OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Unnamed on 05 Feb 2004, 19:13:44
-
Return preprocessed content of given file. Preprocessor is C-like, supports comments using // or /* and */ and macros defined with #define
This is from the Comref. Anyone know how you use macros with #Define ?
Cheers
-
Yeah, for example:
#define private 0
private is the macro, and 0 is the value to replace it with.
so every time you use private in the processed file, it replaces it with zero.
Note that you cannot preprocess .sqfs inside of an addon.
-
I did try this using PreProcessFile on a function in my mission editor directory:
#Define MyMacro "Hello";
Hint Format ["This Macro %1",MyMacro];
But it seems to invalidate the function, you can call it without any errors. It just wont execute the hint until I remove the #Define line.
Am I using it correctly?
Edit:
Scratch that, #define is case sensitive and you dont need a semicolon. This works without any problems:
#define MyMacro Count [1,2,3]
Hint Format ["This Macro %1",MyMacro];
Cheers
P.S I read in an earlier thread about Loadfile and Addons, that functions in an Addon are already processed. Is this correct, I did not think the PBO utils were that sophisticated?
-
It's probably best that you don't go into that unless your good at c++ programming or something, i don't.