Author Topic: SCI Programming Query  (Read 3194 times)

0 Members and 1 Guest are viewing this topic.

Trig

  • Guest
SCI Programming Query
« on: May 23, 2002, 08:52:22 AM »
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?

For Example:

(method (Example params)
    (var index)
    (=index 1)
    (while (index < ParamCount)
          (+= params[index] 5)
          (++ index)
          )
    )

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?



Offline Brian Provinciano

Re:SCI Programming Query
« Reply #1 on: May 23, 2002, 10:18:48 AM »
Yes there is! SCI Studio supports a keyword named "paramTotal". Here's an example of it's use:
   (method (setFeatures features)
      (var i)
      (for (= i 0) (< i paramTotal) (++i)
         (send gFeatures:add(features))
      )
   )

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!


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.046 seconds with 22 queries.