BSCW ServerHelp top
 previous Chapterpreviousupnextnext Chapter  german   Contents    Index  

4.16.5 Functions

To insert some environment values during the evaluation process, the document factory provides several functions that can be used in entities or templates:

&base(file name);
removes path information and the extension from the file name, e.g.:

    &base(/home/bscw/www/faq.bht); -> faq
&rel(path);
generates a relative pathname out of an absolute one, relative to the document that will be generated, e.g.:

If one uses &rel(/Images); in a template, that generates the document /faq/index.htm, it is evaluated to ../Images. If one use it in a template, that generates the document /faq/question/install.htm, it is evaluated to ../../Images.

&size(file name, [B|K|M|G]);
    inserts the size of a file specified by 'file name' in Bytes, Kilobytes, Megabytes or Gigabytes, respectively, depending on the value of the second parameter, e.g.:
      &size(/Download/bscw34.exe, M); -> 8.43
&date(format);
inserts the local time. The following directives can be embedded in the format string. They are shown without the optional field width and precision specification:
DirectiveMeaning
%aLocale's abbreviated weekday name.
%ALocale's full weekday name.
%bLocale's abbreviated month name.
%BLocale's full month name.
%cLocale's appropriate date and time representation.
%dDay of the month as a decimal number [01,31].
%HHour (24-hour clock) as a decimal number [00,23].
%IHour (12-hour clock) as a decimal number [01,12].
%jDay of the year as a decimal number [001,366].
%mMonth as a decimal number [01,12].
%MMinute as a decimal number [00,59].
%pLocale's equivalent of either AM or PM.
%SSecond as a decimal number [00,61].
%UWeek number of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0.
%wWeekday as a decimal number [0(Sunday),6].
%WWeek number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0.
%xLocale's appropriate date representation.
%XLocale's appropriate time representation.
%yYear without century as a decimal number [00,99].
%YYear with century as a decimal number.
%ZTime zone name (or by no characters if no time zone exists).
%%A literal "%" character.

E.g.:


    &date(%M %Y); -> September 2001


 previous Chapterpreviousupnextnext Chapter  german   Contents    Index