Howto:Extend Nasal: Difference between revisions

Jump to navigation Jump to search
m
Line 143: Line 143:
And then get the appropriate value out with things like naNumValue(), naStr_data(), etc...
And then get the appropriate value out with things like naNumValue(), naStr_data(), etc...


So, if were now to change the interface of our earlier "cool" function in the example, to only return "cool" if we are passed at least one numerical parameter, and otherwise return "uncool", it could look like this:
So, if we're now to change the interface of our earlier "cool" function in the example, to only return "cool" if we are passed at least one numerical parameter, and otherwise return "uncool", it could look like this:


  static naRef f_cool (naContext c, naRef me, int argc, naRef* args)
  static naRef f_cool (naContext c, naRef me, int argc, naRef* args)
2,561

edits

Navigation menu