I was perusing through the SCI Studio documentation, but was unable to find a particular piece of information. In the SCI Studio Language, is there any syntax to check the parameter count of the current method or access the parameters by index?|
(method (Example params)
(while (index < ParamCount)
(+= params[index] 5)
In the fantasy land where this code would be correct, it would add 5 to every parameter passed to the method, allow any number of parameters from 0 to a bunch, and be able to reference parameters not specifically identified in the method's declaration.
Is there a way to accomplish this in SCI Studio?
Yes there is! SCI Studio supports a keyword named "paramTotal". Here's an example of it's use:|
(method (setFeatures features)
(for (= i 0) (< i paramTotal) (++i)
Thanks for pointing this out. I must have forgot to add it to the help file.
PS. I'm almost done documenting the class system, and labelling all the variables in the template game (ie. temp123->"name" and param245->"another_name"). It will be here soon!