gwsetup macros

## Macros gwsetup

The following table lists the macros available in gwsetup.
The second colums provides the result of executing the marco in the current context.
Note that depending on the context, some env.var may contain different values.
For instance, when starting setup, the following code in setup.ml (line 1890):

        let conf = {(conf) with env = [("anon", saddr); ("o", s)]
    } in

assigns the current IP address to evar.anon and the content of the only.txt file to evar.o

Macro | Result | Explanation
%/ | %/ | if Sys.unix / else \
%% | %% | %
%a | %a | varies according to context (see macros b, k, s) print evar.anon in top context. (in the context of err_acc.htm, prints the current IP address!)
%b{<li>base %a</li>|no base} | %b{ base %a |no base} | list all bases. Names appear as %a
%c | %c | print setup dir
%d | %d | print conf.comm
%e | %e | print env variables
%ffile.ext; | %fsetup.txt; | Read file file.ext (setup.txt)
%g{..} | %g{test} | print comm.log or content of {..} if does not exist
%h | %h | print env variables
%i | %i | print evar.i
%j | %j | print file selector
%k{<li>%a</li>|no var} | %k{ %a |no var} | print env variables (appear as %a)
%l | %l | print evar.lang
%m | %m | print server name
%n | %n | print referer url
%o | %o | print evar.o (prints content of %y (only.txt) in the context of err_acc.htm!!)
%p | %p | print url variables as -var value (conf.env)
%q | %q | print Version.txt
%r{..} | %r{..} | print gwd.arg or content of {..} if does not exist
%s{ %a |} | %s{ %a |xxx} | for each env variable (%a) whose value is on_ print the content of {...|
%t{...} | %t{.exe} | print content of {} if not Unix (i.e. {.exe})
%u | %u | print setup dir
%v | %v{Test exists (env.var o)} | print content of {...} if env.var o (without extension!) points to an existing base (Test)
%w | %w | print base dir
%x | %x | print bin dir
%y | y | print only_file name (FAILS in this context!! works in the context of err_acc.htm!!)
%z | %z | print the value of gwsetup port
%Cvar=value; | %Ctest=essai; | If evar.var=value then print "checked" (try test=essai)(except lang)
%Evar=value; | %Etest=essai; | If evar.var=value then print "selected" (try test=essai)(except lang)
%Lxx; | %Lfr; | print the full translated value of language xx
%Vvar; | %Vtest; | If evar.var exists (try test), print its value (except lang)
%Fvar; | %Ftest; | Idem V (no difference??)
%G{..} | G{test} | print gwsetup.log or content of {..} if does not exist
%H | H | print content of file designated by -o (prepend bname.gwb)
%K | K | print content of file designated by -o or -o1 (prepend bname.gwb)
%O | %O | print evar.o without extension
%P | %P | print the value of gwd_port
%Q | %Q | print parameters1
%R | %R | print parameters2
%T | T |
%U | U |
%Ivar;value;{true part|false part} | %Itest;essai;{test=essai|test!=essai} | if var=value print true part otherwise false part (not fully tested)
%Iz;;{|:%z} | %Iz;;{|:%z} | another test with a macro as parameter)