Howto:Extend Nasal: Difference between revisions

Jump to navigation Jump to search
m
Line 82: Line 82:
The arguments to the function are passed in in the args array. The number of arguments is passed via argc (this is basically consistent with the standard signature of main in C/C++).
The arguments to the function are passed in in the args array. The number of arguments is passed via argc (this is basically consistent with the standard signature of main in C/C++).


So, if you know that you require a certain number of arguments, you can also directly check argc for matching your requirements.
So, if you know that you require a certain number of arguments, you can also directly check argc for matching your requirements and show an error message, or throw an exception using naRuntimeError().


The "me" reference is set if the function was called as a method call on an object (e.g. object.your_function() instead of just your_function(), in which case "me" would be set to the object).
The "me" reference is set if the function was called as a method call on an object (e.g. object.your_function() instead of just your_function(), in which case "me" would be set to the object).
2,561

edits

Navigation menu