Current Block number in Custom Blocks
-
I am on switching from offline to online version and running in trouble with my custom blocks:
There is a global variable
int aLoopIndex[];and here the source of my loop block which worked in Desktop version:
int This_Block_Id = FXD_CURRENT_FUNCTION_ID;
if (ArraySize(aLoopIndex) < (This_Block_Id +1)) {
ArrayResize(aLoopIndex,(This_Block_Id + 1));
}for (int i = 0; i < Cycles; i++) {
aLoopIndex[This_Block_Id] = i;
~next~
}
aLoopIndex[This_Block_Id] = -1;
~inext~
Now in online Version FXD_CURRENT_FUNCTION_ID is not working anymore.
What is the right variable to use instead?
-
Try ~X~
Better don't use those variables and functions that I created, because sometimes I change them. This ~X~ thing is semi-official, I may change it some day as well, but this is more unlikely. It gives you the block number. Or I'm not sure, to be honest :))) Because now there are at least two different sets of block numbers
But I'm currently using it in some blocks, for example in those Draw blocks: -
@fxdreema said in Current Block number in Custom Blocks:
ly. It gives you the block number. Or I'm not sure, to be honest :))) Because now there are at least two different sets of block numbers
But I'm currently usingThanks I will modify my code. What do you think about taking my loop as a Standard Block
I guess I am not allone with the need to have a simple loop and knowing the current iteration