Bug #22835

OFP Rapify formats macro argument parameters

Added by Faguss over 3 years ago. Updated over 3 years ago.

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

0%

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

Description

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.

Result:
x = "space,";

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

History

Updated by mikero over 3 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 over 3 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 3 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