Index Special Tags Predefined Tags Implementation Home
Introduction to predefined Tags
    Related sites:
How to create a predefined tag
Class information for the tags
The BOOLEAN Tag

    Syntax: {BOOLEAN::some_text::compare_sign::some_text::output_if_true::output_if_false}
    Function: compares two figures with a specified sign (<, = or >)
    Example:

    *OUTPUT_TRUE
    true

    *OUTPUT_FALSE
    false

    {BOOLEAN::5::<::10::OUTPUT_TRUE::OUTPUT_FALSE} // returns 'true'

The CALCULATE Tag

    Syntax: {CALCULATE::number::sign::number::output_tag_name}
    Function: calculates a result from two numbers
    sign: +, -, *, /, % or ^
    Example:

    *OUTPUT
    {RESULT::.2f}

    {CALCULATE::10::%::5} // returns 0

The DATE Tag

    Syntax: {DATE}, {DATE::[+|-][mi|hh|dd|mm|yy]digit}
    Function:

    {DATE} returns the actual date (weekday mmm dd hh:mm:ss time zone yyyy)

    {DATE::[+|-][mi|hh|dd|mm|yy]digit} returns the actual date plus or minus a certain time.

    [+|-] plus or minus the specified time

    [mi|hh|dd|mm|yy] time to be added or substracted - mi stands for minute, hh for hour, dd for day, mm for month and yy for year

    digit how many times the specified time should be added or substracted

    Example:

    {DATE} returns
    Mon May 17 11:39:37 PDT 1999

    {DATE::+mm1} returns
    Thu Jun 17 11:39:39 PDT 1999

The DBMS Tag

    Syntax: {DBMS::SQL Statement::OUTPUT}
    Function:

    It returns the result of the specified SQL Statement and calls an OUTPUT tag which outputs the result in a formatted way. The format is defined in the OUTPUT tag, also which fields of the result set should be printed.

    The database is configurated with the DB tag which is called with the program start. The DB tag contains the name of the database, the connection, username and password.

    If something happens during the database connection or if an exception occurres, the EXCEPTION tag will be called automatically. With the DEF tag (description below) it is possible to redefine the EXCEPTION tag.

    The OUTPUT tag should be defined as follows:

    *OUTPUT {cellname::format}

    where as many cellname::format pairs can be defined as wanted, maximum as much as fields are available. The format is defined with a percent sign (%) first, and then:

    +      forces display of + for positive numbers
    0      Show leading zeroes
    -      align left in the field
    space  prepend a space in front of positive numbers
    #      use "alternate" format. Add 0 or 0x for octal or hexadecimal numbers.
           Don't suppress trailing zeroes in general floating point format.
    Digit  an integer denoting field width (optional)
    Period a period followed by an integer denoting precision (optional)
    Format a format descriptor (required)
    Digit  floating point number in fixed format
    Digit  floating point number in exponential notation (scientific format). The E
           format results in an uppercase E for the exponent (1.14130E+003), the e
           format in a lowercase e.
    Digit  floating point number in general format (fixed format for small numbers,
           exponential format for large numbers). Trailing zeroes are suppressed. The
           G format results in an uppercase E for the exponent (if any), the g format in
           a lowercase e.
    d, I   integer in decimal
    x      integer in hexadecimal
    o      integer in octal
    s      string
    c      character
    

    Example:

    {DBMS::SELECT * FROM Articles::OUTPUT}

    *OUTPUT
    {fFreight::%+4.2f} {iStatus::%d}

The DEF Tag

    Syntax: {DEF::Tagname::new Tagvalue}
    Function: If a tag with the specified tag name exists, then its value will be overwritten by the new tag value.
    Example: {DEF::COUNT::true} The COUNT tag will be overwritten with the value "true" - the next time it is called, it will output "true".

The EXCEPTION Tag

    Syntax: {EXCEPTION[::int]}
    Function: This will show the exceptions which are currently stored in the exception list. If an int argument is given, it will only show the exceptions with the specified errorlevel or with an errorlevel less than it.
    Example:

    {EXCEPTION::2}

    This will show all exceptions with errorlevel 2 or less.

The EXEC Tag

    Syntax: {EXEC::Batchfile::file::success::no success} {EXEC::Batchfile::file::success::no success::file path}
    Function:

    The EXEC tag will call a specified DOS batchfile with a file as argument. The batchfile itself will use this argument and return with an errorcode whether the operation was successful or not. You may also specify a path as last argument. If no path is defined, the batchfile and the textfile will be stored shortly in the default temp directory.Both files will be deleted after finishing the compilation.

    If no exception occurres, PReP will carry out the next argument ("success") or it will go to the "no success" instructions.

    The output text of the batch file is stored in a tag named EXEC_MESSAGE.

    Example:

    {EXEC::anything.bat::anyfile.java::everything has worked!::some exception occurred}

    PReP will execute the "anything.bat" file with the "anyfile.java" file as argument. The "anything.bat" file may now execute the "anyfile.java" file and then return to the waiting PReP program. If everything was ok, PReP will output: "everything has worked!", or if an exception occurred: "some exception occurred".

The FILEREADER Tag

    Syntax: {FILEREADER::path\filename}
    Function:

    The FILEREADER reads a file and outputs without compiling it.

    Example:

    {FILEREADER::p:\global\commongw\sources\tree.txt}

The FOREACHARG Tag

    Syntax: {FOREACHARG::Some tag}
    Function:

    If something should be applied to several arguments, but the number of arguments is not known yet, the FOREACHARG can be useful for that. This tag must be called in another tag.

    It will take its argument ("Some tag") and will now for each argument its parent tag is called with execute the specified tag.

    Example:

    *SOMETAG

    {FOREACHARG::ANYTAG}

    *ANYTAG
    <TD>{ARG1}</TD>

    {SOMETAG::1::2::3::4::n}

    It will output different cells with the numbers 1..n in a HTML table - as many as are specified in the call.

The IF Tag

    Syntax: {IF::Tag name::Tag value::true::false}
    Function: If there exists a tag with the specified tag name (argument 1) and value (argument 2), then follow the instructions of the next argument ("true") and if not, then follow the instructions of the argument "false"
    Example:

    {IF::ANYTAG::hello world!::hallo welt!::this tag does not exist!}

    If ANYTAG exists and has "hello world!" as value, PReP will output "hallo welt!" - otherwise it will return "this tag does not exist!".

The IFDEF Tag

    Syntax: {IFDEF::Tag name::true::false}
    Function: If there exists a tag with the specified tag name (argument 1), PReP follows the instruction in "true" or otherwise in "false
    Example:

    {IFDEF::ANYTAG::this tag exists!::this tag does not exist!}

    If ANYTAG exists, PReP will return "this tag exists!" and otherwise "this tag does not exist!"

The IMG Tag

    Syntax: {IMG::webroot::fileroot::filename::other_HTML_attributes}
    Function: returns a complete HTML IMG tag with the HEIGHT and WIDTH of the specified picture.
    Example:

    {IMG:: http://www.delec.com/::w:\www\::is/products/images/prep.gif::NOBORDER}

    returns:
    <IMG SRC="http://www.delec.com/is/products/images/prep.gif" HEIGHT="378" WIDTH="417" NOBORDER>

The LIST Tag

    Syntax: {LIST::List name::Tag name}
    Function: The LIST tag will get the specified list and modifies the argument of the list with the specified tag ("Tag name")
    Example:

    *ANYTAG
    <B><I>{ARG1}</I></B> = {ARG2}<BR?

    *ANYLIST
    one::1
    two::2
    three::3

    {LIST::ANYLIST::ANYTAG}

    The output will look as follows:

    one = 1
    two = 2
    three = 3

    or as HTML source:

    <B><I>one </I></B> = 1<BR>
    <B><I>two</I></B> = 2<BR>
    <B><I>three</I></B> = 3<BR>

The LISTITEM Tag

    Syntax: {LISTITEM:: key::LIST::output tag to display the item}
    Function: For some reasons it would be nice to have a tag which can access an item, specified with a key. Of course this must be a list which is composed with a key and a text which would look as follows: key::text.
    Example:

    *COLORLIST
    0::<FONT COLOR="red">
    1::<FONT COLOR="orange">
    2::<FONT COLOR="lightgreen">
    3::<FONT COLOR="green">

    *COLOROUTPUT
    {ARG1} {OUTPUT} </FONT>

    *OUTPUT
    this has to be lightgreen!

    *COLOR
    2

    *MAIN
    {LISTITEM::{COLOR}::COLORLIST::COLOROUTPUT}

    returns:

    <FONT COLOR="lightgreen">this has to be lightgreen</FONT>

The NBSP Tag

    Syntax: {NBSP::text[::int]}
    Function: The NBSP tag will replace any whitespaces in the text argument with a HTML " " - if there is an int argument, it will also replace the tabs with as much " " as the int shows
    Example:

    *SOME_TEXTTAG

    this text will have   whitespaces		and tabs!

    {NBSP::{SOME_TEXTTAG}::5}

    The output will look as follows:

    this text will have whitespaces         and tabs!
    

The PARSE Tag

    Syntax: {PARSE::file_name::tag_name}
    Function: The specified file will be opened and parsed. Then the specified tag will be compiled. The TagList will be resized afterwards.
    Example:

    *TEST
    {TAG_FROM_THE_OTHER_FILE}

    {PARSE:: p:\global\commongw\sources\com\delec\prep\testfiles\testfile.prep::TEST}

The TAGLIST Tag

    Syntax: {TAGLIST}
    Function: This tag will output every tag which is currently stored in the tag list
    Example: {TAGLIST}