Well, prerocessor doesn't know the sqf-syntax, but it knows that such a string. All that is enclosed in quotation marks preprocessor leaves as is. I'm happy to be removed unnecessary macro, but I don't know how to do it.
The preprocessor does not process anything inside " which is what delimits strings in C. However, in SQF, strings can be in single quotes which the preprocessor doesn't care about, so you can use 'mcrGlobalDisplayStorage'. On the other hand, since it is usual to want to have a macro inside double-quotes, you can use #mcrGlobalDisplayStorage which will expand the macro then wrap that is double-quotes which also works as you want it to. Your solution is fine, but I was explaining two simpler workarounds since it might make other things you are doing simpler (and it is always good to have more weapons in the armoury
).
This is only one function, name it as you are comfortable.
I'm afraid that I not be allowed into heaven if I mixed in one name snake_case and camelCase
I would like to use the prefix rls, if he is not busy.
Well, since the function is inside your script, then you are the one that is in control of its name. It is always better to take responsibility for anything in scripts you release, since you should expect users to not be running around inside your code altering stuff just to make it work (it should work in all circumstances without them needing to edit it).
As far as tags (or anything else goes) there are sylistic things (such as
spon_cheese versus
SPON_cheese, since SQF ignores case) and there are functional things (such as
cheese vs
SPON_cheese). Frankly, the former are just going to cause arguments between people who should know better and the latter are things which will cause your script to crash and burn when used with other people's.
RLS_ tag is, in fact, available; just
register it so no-one else uses it and we can all be sure your tagged namespace doesn't step on any other developer. Incidentally, the underscore is a requirement, since it removes your namespace globals from those developers who don't bother to even use a tag (your
RLSLap == non-tag using developer's
rlSlap, but
RLS_lap is an actual separated namespace; well, OK, that isn't a perfect argument since you wouldn't be "separate" from people using snake case...but can't be perfect).
I'm not sure that I understood the idea.
Variables are stored in an array, rather than in a some nameSpace. They need to create and then save their values in the array. A solution could be to use the reception:{
// pseudo-closure
_var1 = something;
_var2 = something;
waitUtil {
if( some event ) then {
call eventHandler
};
some event != close
}
}
But it seriously worsen the response time. Perhaps you have an idea how to solve it?
Well, if you can store the function somewhere, you can store some extra values in the same place, rather than storing them inside the function itself. Can't concentrate hard enough to work out how you'd get around this need for compiled code, but I think any removal of dynamic code is a boon. Not utterly sure it is possible though...
Hmm. I don't use onLoad handler, but _constructor have access to the current namespace and dialog-namesapce:
onLoad is critical for overlays that are modified (since it is the only way to get the display handle) and can help you ensure that dialogs work better together (since you don't have to wait until the dialog is created and ensure that it wasn't closed before it got opened and you know it is definitely the open you opened and not another one, etc.).
To be picky again, the attached script in your first post should always be updated with the
latest version of your script. This is the first one anyone coming to your thread should see and want to download and keeping this as the only version available simplifies things (believe me, people will often not go past your first post, especially if your thread is long and give them two files to download and they'll pick a random one rather than bother reading the name of the file
). Personally, I would recommend only putting files in your first post and linking back to that post in later posts if they get updated. Having a date or version number on your files makes a big difference, but people shouldn't have to trawl through the entire thread to find the latest version.