View Single Post
  #4  
Old 01-14-2006, 07:30 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Stefan
There might be some misunderstanding about "params[]". It is always containing the parameters given to the script call, which means an event occured and is executing either the whole script (old script style) or a single event handler function, or you call a function of another object. When a gani script is executed then params[] will contain the gani parameters passed to setani() or setcharani().

So params[] is not containing the function parameters, that is only the case if you access it in the event handler function. Question is if it should be changed, it could make things more slow. Best solution in your case would be to accept two parameters - if the caller is only providing one parameter then the second parameter will be zero, which you could check. Or you do two different functions, for better readibility and so making it easier for other scripters to understand your code.

Hmmm on the new Graal Bible (http://wiki.graal.net) we should eventually add a script FAQ were such things are added (once they get answered in this forum).
okay, thanks.
Reply With Quote