![]() | ![]() | ![]() | Variables and Declarations |
Variables are implicitly declared in NASL; this means that it is not necessary
to declare any variables before use. You can however use the local_var
keyword to declare a variable as local to a certain function and avoid
collisions with external variables. By default, NASL considers a variable to be
local to the context in which it was declared; if you want to declare a
variable as global, you can use the global_var keyword.
In contrast to C (and other languages), variable types do not have to be declared in advance; the NASL interpreter will use the appropriate type the first time the variable is assigned. Memory allocation is automatically handled by the interpreter as well.
![]() | ![]() | ![]() | Variables and Declarations |