Jump to content
  • 0

Functions in functions


Guest

Question

Hey guys, Bowbii here..

 

I've got a little questions, pretty easily answered I assume.

My_fnc = { ...code... };

then, I want My_fnc to be something else.

So I wrote this:

MyFNCChange = { My_fnc = { ..new code..}; };

And I'm calling it via spawn/call MyFNCChange..

Problem is, My_fnc gets redifned even if I didn't call MyFNCChange..

 

Has anyone a solution for this?

It would be great!

- xBowBii

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I am guessing 0verHeaT is suggesting that preprocessing MyFNCChange may be calling the code that changes the My_fnc value.  If you are not doing it then it wont be the problem.

 

Have you tried an alternative.

OldFuncCode = {...code...};
NewFuncCode = {...code...};

MyFNCInit = {MyFunc = OldFuncCode;};
MyFNCChange = {MyFunc = NewFuncCode;};

nil = [] call MyFNCInit; //Set initial MyFunc code block to OldFuncCode.
nil = [] call MyFNCChange; //Change MyFunc code block to NewFuncCode.

Sitting in the office so may have bugs and can't test but an alternative suggestion you could try.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...