Howto:Extend Nasal: Difference between revisions

Jump to navigation Jump to search
m
Line 96: Line 96:


= Argument Processing =  
= Argument Processing =  
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 the argc parameter (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 and show an error message, return nil, or throw an exception using naRuntimeError():
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, return nil, or throw an exception using naRuntimeError():
2,561

edits

Navigation menu