Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add QQ macros for escaped config implementation #383

Merged
merged 1 commit into from
Jun 18, 2016
Merged

Add QQ macros for escaped config implementation #383

merged 1 commit into from
Jun 18, 2016

Conversation

jameslkingsley
Copy link
Contributor

When merged this pull request will:

  • Add the following macros:
    • QQGVAR
    • QQEGVAR
    • QQGVARMAIN
    • QQFUNC
    • QQFUNCMAIN
    • QQFUNC_INNER
    • QQEFUNC

This is useful for when you need to escape these macros in a config.

Before:

expression = QUOTE(\
    GVAR(camSlowDownInBuildings) = _this;\
    [ARR_2(QUOTE(QGVAR(camSlowDownInBuildings)), _this)] call CFUNC(saveSetting);\
);

After:

expression = QUOTE(\
    GVAR(camSlowDownInBuildings) = _this;\
    [ARR_2(QQGVAR(camSlowDownInBuildings), _this)] call CFUNC(saveSetting);\
);

@commy2
Copy link
Contributor

commy2 commented Jun 17, 2016

While I do support this, you could've also used:

expression = QUOTE(\
    GVAR(camSlowDownInBuildings) = _this;\
    [ARR_2('GVAR(camSlowDownInBuildings)',_this)] call CFUNC(saveSetting);\
);

@nicolasbadano
Copy link
Contributor

@commy2, do macros work inside single quotes??

@commy2
Copy link
Contributor

commy2 commented Jun 17, 2016

@commy2
Copy link
Contributor

commy2 commented Jun 17, 2016

@nicolasbadano
Copy link
Contributor

I'm confused. Why don't we always just do this then?

expression = 'GVAR(camSlowDownInBuildings) = _this;\
    [ARR_2(QGVAR(camSlowDownInBuildings),_this)] call CFUNC(saveSetting);\
);'

@jameslkingsley
Copy link
Contributor Author

I must have got it mixed up. I though that only works in SQF files.

@commy2
Copy link
Contributor

commy2 commented Jun 17, 2016

I'm confused. Why don't we always just do this then?

Won't work. I think this is because ' is the escaping quote mark and not ".

@Killswitch00 Killswitch00 merged commit 840fb11 into CBATeam:master Jun 18, 2016
@commy2 commy2 added this to the 2.4.2 milestone Jun 19, 2016
@commy2 commy2 added the Feature label Jun 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants