Bug #22835

OFP Rapify formats macro argument parameters

Added by Faguss almost 6 years ago. Updated over 5 years ago.

Status:Closed Start date:07/26/2011
Priority:Low Due date:
Assignee:mikero % Done:


Category:Rapify (Dos Tools)
Target version:-
Affected Version:3.57


Spaces, comments are ignored when you pass them as a macro parameter.

Steps to reproduce:
1) Start Eliteness.
2) In options select "Resistance"
3) Create text file and paste:

#define myFunction(arg1,arg2) arg1,arg2
x=myFunction(  space  ,/* comment */);

4) Binarize it.

x = "space,";

Expected result:
x = "  space  ,/* comment */";


Updated by mikero almost 6 years ago

  • Status changed from New to Feedback

the correct syntax for above is

x=myFunction( "space" ,"/* comment */");

this is a typical user error. it is not explicit whether 'my comment' is simply meant to be a description of what the macro does, or, is meant to be passed as a string.

It is fairly clear (to me) that the above is meant to be an argument, but even experienced scripters often misttype a , when they meant ("space")/*, my comment*/

basically, if you're passing strings "say so"

Updated by Faguss almost 6 years ago

In OFP strings do not require quotation marks. Game does not process text in the macro bracket, just copies it.

Updated by mikero over 5 years ago

  • Status changed from Feedback to Closed

the dll uses Trim functions to discard leading/trailing whitespace

use quotes to include space chars and to avoid misinterpretation of #defines and "/*oddly inserted comments*/

Also available in: Atom PDF