Functions Blocks

Functions

{"func":"blockControlCallMember"}

Call Function

"Call Function" calls a specific actor's function. This means you can call the function of one actor from another actor (or itself). You can also pass parameters to this function.

Parameters:

Actor: this parameter specifies the actor whose function is being called.

Function: this parameter specifies the actor's function to be called. You can also pass parameters to this function.

Related Blocks:
{"func":"valueControlCallMember"}

Sample Code:
{"func":"blockControlCallMember","values":[{"type":"string","value":"soccer player"},{"type":"string","value":"kick"}]} Add to my Backpack


{"func":"valueControlCallMember"}

Function Value

"Function Value" returns the value of a specific actor's function. This means you can call the function of one actor from another actor (or itself). You can also pass parameters to this function.

Parameters:

Actor: this parameter specifies the actor whose function is being called.

Function: this parameter specifies the actor's function to be called. You can also pass parameters to this function.

Related Blocks:
{"func":"blockControlCallMember"}

Sample Code:
{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueOpBinary","values":[{"type":"wrapper","func":"valueControlCallMember","values":[{"type":"string","value":"team1"},{"type":"string","value":"score"}]},{"type":"choice","value":">="},{"type":"string","value":"5"}]}],"containers":[{"func":"blockControlCallMember","values":[{"type":"string","value":"scorecard"},{"type":"string","value":"win"},{"type":"string","value":"team1"}]}]} Add to my Backpack


{"func":"blockControlReturn"}

Return

"Return" returns the given value. This means whenever you call the function that this code block resides it, you can retrieve this value.

Parameters:

Return value: this parameter is the value that the function is returning.

Related Blocks:
{"func":"blockVarSet"}

Sample Code:
{"func":"registerFunction","cat":"functions","name":"Multiply By 2","label":"Multiply By 2 {param:Num}","hasFlap":false,"values":[{"type":"wrapper","func":"valueParam","name":"Num"}],"next":{"func":"blockControlReturn","values":[{"type":"wrapper","func":"valueOpMultiply","values":[{"type":"wrapper","func":"valueParam","name":"Num"},{"type":"number","value":"2"}]}]}} Add to my Backpack