24 lines
832 B
Markdown
24 lines
832 B
Markdown
## Innclude Statement
|
|
|
|
In AVAP, the include statement is used to include an entire code file and define names in the local namespace. The syntax for the include statement is as follows:
|
|
|
|
```javascript
|
|
include file.avap
|
|
```
|
|
|
|
The include statement in AVAP includes an entire code file and makes it available in the local namespace. No alias is assigned to the included file; the file is simply referred to by its name.
|
|
|
|
For example:
|
|
|
|
```javascript
|
|
# In the 'module.avap' file
|
|
example_variable = 10
|
|
|
|
# In the main file
|
|
include module.avap
|
|
addResult(example_variable)
|
|
# Will print 10
|
|
```
|
|
|
|
In this example, the main file includess the `module.avap` file and can access the `example_variable` defined in that file using the `module.avap` syntax.
|