| Search internet |
In normal use, the lgwam command is installed in /usr/bin/lgwam and is used as the first line of Logiweb scripts. The first line of such scripts typically read
#!/usr/bin/lgwam script
The Logiweb compiler lgc(1) generates such scripts. The format of scripts is described in SCRIPT FORMAT below.
A script may look thus:
#!/usr/bin/lgwam script
string
015F43BE4A17DAD915936B7A773154A80946AEC82EFBEECDA4A7D7B80806
hello
execute
foo=bar
magicword=xyzzy
The first line starts with a hash mark so it is ignored.
The first proper line (the second line) indicates the format of the rest of the script. The 'string' format is the only format which is not deprecated, so the first proper line always says 'string'.
The second proper line contains the reference of a Logiweb page expressed in mixed endian hexadecimal, c.f. REFERENCES below.
The third proper line indicates the name of the program ('hello' in this case).
The fourth proper line indicates the aspect defining the program. The lgc compiler always sets the aspect to 'execute'.
All remaining lines define script options which are passed to the program.
When lgwam executes a Logiweb script, it first loads the referenced page and all its transitively referenced pages. It does so using the LGW_PATH environment variable described under ENVIRONMENT below.
Then lgwam looks up the given aspect of the given name on the referenced page where both aspect and name are treated as strings. The base page which comes with the distribution defines the 'execute' aspect of 'hello' such that the resulting program prints 'Hello World'.
Then lgwam invokes the given aspect of the given name in the way described on the base page. See the base page for further information.
$HOME/.logiweb/logiweb/:/rack.lgr
The value of LGW_PATH must be a list of locations separated by semicolons. The default path above contains only one location and, thus, no semicolons.
To load a referenced page, lgwam tries each location in turn. For each location, lgwam replaces the rightmost colon character by the reference of the page expressed in mixed endian hexadecimal, c.f. REFERENCES below. Then lgwam reads the file at the resulting path, if any. The file must be a rack file, c.f. logiweb(5).
In mixed endian hexadecimal, each byte is represented by two hexadecimal digits with the most significant digit first. Bytes are given in network order. Capital letters are used for the hex digits A to F.
| Search logiweb.eu |