I see that functions have an option to be made an operator, but I'm not really sure how to use this.
Has anyone had any success making custom operators?
If I wanted to create the classic unary increment operator, is this how I would go about it, or would that be something different? I'm getting very tired of doing Set Variable -> i = Arithmetic(i + 1) in GUI.
Operators will not compile to functions, instead, their custom script gets inserted at the point they are used.
So if you, for example, wanted to create an "increment by one" operator, it could work as follows:
1. Create a new action and check the operator flag
2. As parameter, add an integer, we will call the parameter "var" in this case.
3. As custom script code, enter the following:
#PARAM(var) += 1;
When using the function in script it will get inlined by the gui to galaxy compiler, and #PARAM(var) will be replaced with the variable name.
I see that functions have an option to be made an operator, but I'm not really sure how to use this.
Has anyone had any success making custom operators?
If I wanted to create the classic unary increment operator, is this how I would go about it, or would that be something different? I'm getting very tired of doing Set Variable -> i = Arithmetic(i + 1) in GUI.
@Apollys: Go
Why not use the Modify Variable (Integer) function instead?
Operators will not compile to functions, instead, their custom script gets inserted at the point they are used.
So if you, for example, wanted to create an "increment by one" operator, it could work as follows:
1. Create a new action and check the operator flag
2. As parameter, add an integer, we will call the parameter "var" in this case.
3. As custom script code, enter the following:
#PARAM(var) += 1;
When using the function in script it will get inlined by the gui to galaxy compiler, and #PARAM(var) will be replaced with the variable name.
AHAH! This is the magic I have been looking for for so very long. (forum messed up my quote :( )
And thanks ScorpSCII, I actually never knew that function existed! Haha...