Using Nasal functions: Difference between revisions

Jump to navigation Jump to search
m
→‎Default values for function arguments: the comment made the example invalid
m (→‎Default values for function arguments: the comment made the example invalid)
Line 112: Line 112:


  #Incorrect:
  #Incorrect:
  var log_message = func(msg="error", line, object="ground") { #some code }
  var log_message = func(msg="error", line, object="ground") {  
#some code  
}


<syntaxhighlight lang="php">
<syntaxhighlight lang="php">
  #Correct:
  #Correct:
  var log_message = func(msg="error", object="ground", line) { #some code }
  var log_message = func(msg="error", object="ground", line) {  
#some code  
}
</syntaxhighlight>
</syntaxhighlight>


Navigation menu