assistance-engine/docs/developer.avapframework.com/chapter14_2.md

580 B

Function Construction

In AVAP™, similar to Python, functions are defined using the keyword function , followed by the function name and its parameters in parentheses. The function definition ends with a ( { ), followed by the block of code that forms the function body, and closed by (}).

Defining a function in AVAP™

function greet(name){
            return("Hello, " + name + "!")
          }

Calling the function

message = greet("World")
            addResult(message)

Output

Hello, World!