我在需要定义的类中有一组函数。每个都将不同的值传递给另一个函数:
void function00(object self, taggroup tg) self.otherfunction(tg,0,0)
void function01(object self, taggroup tg) self.otherfunction(tg,0,1)
void function02(object self, taggroup tg) self.otherfunction(tg,0,2)
void function03(object self, taggroup tg) self.otherfunction(tg,0,3)
void function04(object self, taggroup tg) self.otherfunction(tg,0,4)
我有 100 个这样的函数,我不想单独定义每个函数。考虑到上面的例子,我想做一些类似的事情:
for(number i=0; i<5; i++){
void function0+i(object self, taggroup tg) self.otherfunction(tg,0,i)
}
这对它自己不起作用。有什么建议么?
对于更多上下文,我在 2 for 循环中创建了一系列复选框,其中包含以下内容:
BOXinsides.DLGAddElement(DLGCreateCheckBox(label,0,"function"+i+j).DLGIdentifier("#function"+i+j))
我需要以某种明智的方式定义所有功能。