[Vimoutliner] Parsing outlines with awk?
Lucas Gonzalez Santa Cruz
lucas.gonzalez at canarias.org
Fri Mar 30 08:47:03 EST 2007
>By the way, does anyone know if awk has local variables, and if so, how
>does one distinquish them from global variables?
http://en.wikipedia.org/wiki/AWK_(programming_language)#User-defined_functions
===== cut-n-paste =====
User-defined functions
In a format similar to C, function definitions consist of the keyword
function, the function name, argument names and the function body. Here is
an example of a function.
function add_three (number, temp) {
temp = number + 3
return temp
}
This statement can be invoked as follows:
print add_three(36) # Outputs 39
Functions can have variables that are in the local scope. The names of these
are added to the end of the argument list, though values for these should be
omitted when calling the function. It is convention to add some whitespace
in the argument list before the local variables, in order to indicate where
the parameters end and the local variables begin.
===== end of cut-n-paste =====
More information about the VimOutliner
mailing list