preprocessFileLineNumbers: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " +" to " ") |
Lou Montana (talk | contribs) m (Text replacement - " \| *(\[\[[a-zA-Z0-9]+\]\][^ ]+) *\|x1=" to " |r1= $1 |x1=") |
||
Line 21: | Line 21: | ||
|p1= fileName: [[String]] - path to the file | |p1= fileName: [[String]] - path to the file | ||
| [[String]] - file content containing <tt>#line 1 "aFilename"</tt> | |r1= [[String]] - file content containing <tt>#line 1 "aFilename"</tt> | ||
|x1= <code>_string = [[preprocessFileLineNumbers]] "A3\ui_f\scripts\IGUI\RscUnitInfo.sqf"</code> | |x1= <code>_string = [[preprocessFileLineNumbers]] "A3\ui_f\scripts\IGUI\RscUnitInfo.sqf"</code> |
Revision as of 13:21, 12 June 2021
Description
- Description:
- Description needed
- Groups:
- System
Syntax
- Syntax:
- Syntax needed
- Parameters:
- fileName: String - path to the file
- Return Value:
- String - file content containing #line 1 "aFilename"
Examples
- Example 1:
_string = preprocessFileLineNumbers "A3\ui_f\scripts\IGUI\RscUnitInfo.sqf"
Result is:
#line 1 "A3\ui_f\scripts\IGUI\RscUnitInfo.sqf"
disableserialization;
........
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
- Posted on December 17, 2013
- Killzone_Kid
- The main difference between preprocessFile and preprocessFileLineNumbers is that the latter adds #line keyword to the target file, which allows to log the __LINE__ error happened at and the __FILE__ error happened in.
- Posted on November 4, 2017 - 10:16 (UTC)
- code34
-
The #line directive get's removed from the output.
So to add a custom #line directive before while using preprocessFileLineNumbers, you have to use a preprocessor macro like this:
#define DEBUG(sharp,name) sharp##line 0 name
and add this at the right place in your code
DEBUG(#,"your filename"); This way you can have custom filenames in error messages.