Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

ReplaceMacros second parameter in scripts

(1/2) > >>

BlueHazzard:
maybe it is to late for me, but can someone lighten me what the second parameter in ReplaceMacros in the wizardscripts is?

ex. wxWidgets project script the boolean false:

--- Code: ---buffer.Replace(_T("[NOW]"), ReplaceMacros(_T("$(TODAY)"), false));
--- End code ---

in the wiki is only one parameter
http://wiki.codeblocks.org/index.php?title=Scripting_commands

--- Code: ---wxString ReplaceMacros wxString Does variable expansion on the input wxString
--- End code ---

and also the binding is made only with one parameter

--- Code: ---wxString gReplaceMacros(const wxString& buffer){ return Manager::Get()->GetMacrosManager()->ReplaceMacros(buffer); }
SqPlus::RegisterGlobal(gReplaceMacros, "ReplaceMacros");
--- End code ---

i have no idea where this second parameter is going...

greetings

stahta01:
I am guessing its a mistake.

I found the below in macrosmanager.h

--- Code: ---    void ReplaceMacros(wxString& buffer, ProjectBuildTarget* target = nullptr, bool subrequest = false);
    wxString ReplaceMacros(const wxString& buffer, ProjectBuildTarget* target = nullptr);

--- End code ---


I am guessing its using the second of those above.

Just a guess.

After looking closer; I think it is the first one of the two above.

Tim S.

oBFusCATed:
Does the script works or it fails with errors?
Probably is bug in the script.

LETARTARE:
I never used the second parameter.
But if you put it, it does not generate an error !
If the second parameter was necessary script would generate a runtime error, because all parameters must be specified.

I think it is a mistake that spread by copying ...

BlueHazzard:
hmm
The scripts work on the actual implementation of squirrel in c::b. But with my new with sqrat binding they crash, because of the wrong parameter count.
I don't understand why this scripts aren't crashing in the actual version, because there is no binding to squirrel for a function with 2 parameters.

Navigation

[0] Message Index

[#] Next page

Go to full version