tlaRevision
Apply Date/Time Stamp to Special HTML String

CodeWright® - API Macro - Royalty Free - 2005.01.01 17:15
Send Comments

Purpose

Apply Date/Time Stamp to Special HTML String.

This function stamps the current date/time between two delimiters found on any line anywhere in a file. These delimiters are of the form

<tlaRevision>   </tlaRevision>

This function also supports the delimiters used in an earlier (pre-XML era) implementation. These delimiters are of the form:

<!--tlaRevision-->   <!--tlaRevision-->

The reason you might want to do this is to automate the stamping of ASP and HTML files to provide a date/time visible to the website visitor that documents when the page was last updated.

It is useful to have a "starter" string in the template that you use for module creation. An example of a "starter" string might be:

Revised <tlaRevision></tlaRevision> by AJL.

Operation

This function will convert:

<tlaRevision>anything at all</tlaRevision>

To a string such as:

<tlaRevision>2002.06.20 18:31</tlaRevision>

In addition, this function will convert the older style delimiters to the new style. It will convert a string of the form:

<!--tlaRevision-->anything at all<!--tlaRevision-->

To a string such as:

<tlaRevision>2002.06.20 18:31</tlaRevision>

Example

Original contents of file ...

Revised <tlaRevision>1999.11.30 03:18</tlaRevision> by AJL.

Contents after executing tlaRevision ...

Revised <tlaRevision>2002.06.20 18:31</tlaRevision> by AJL.

And this would appear to the website visitor as ...

Revised 2002.06.20 18:31 by AJL.

Input Parameters

None.

Return Codes

Count of replacements made in the file (zero if none were made).

Reference

This function calls tlaDateTime.

Compatibility

Current version verified under:

  • CodeWright 7.0b
  • CodeWright 7.0c
  • CodeWright 7.5.1
  • CodeWright 7.5.2
  • CodeWright for .NET 7.0

CodeWright for .NET Restriction

None.

Installation

There are three primary methods for installing this macro on your system. Method A uses the tlaMDE tool available for purchase from this website. Method B manipulates the macro repository directly. Method C uses the API Macro... tool provided in every copy of CodeWright (but not CodeWright for .NET).

Method A - tlaMDE - CodeWright or CodeWright for .NET

  • Select the Code button on this page.
  • When the second window opens, select all the text in the text box.
  • Issue Ctl-C (copy).
  • Create a new file in CodeWright or CodeWright for .NET.
  • Issue Ctl-V (paste).
  • Issue tlaMDE C (save and compile).

Method B - Copy to Repository - CodeWright or CodeWright for .NET

  • Select the Code button on this page.
  • When the second window opens, select all the text in the text box for a macro.
  • Issue Ctl-C (copy).
  • Load the macro repository "cwright.mac" from your CodeWright or CodeWright for .NET root:
  • issue Ctl-End to go to the end of file.
  • Issue Ctl-V (paste).
  • Close the file and respond yes to the write request.

Method C - API Macro ... - CodeWright Only

  • Select the Code button on this page.
  • When the second window opens, select text from the text box for a macro:
    • Do not select the [API Macro ... header line.
    • Select all other lines in the macro.
  • Issue Ctl-C (copy).
  • Open the CodeWright Tools | API Macros... dialog.
  • Press the New button.
  • Select the Edit box.
  • Issue Ctl-V (paste).
  • Double-click on the function name in the header of the macro.
  • Issue Ctl-C (copy).
  • Select the Name box.
  • Issue Ctl-V (paste).
  • Delete the trailing blank from the name.
  • Select the Save button.
  • Select the Close button.
  • Repeat this process for each macro in the text box.

Purchase

tlaTools is a Dynamic Link Library that contains most of the API macros on this website in a single easy to install package. The tlaTools DLL can be purchased by selecting the Buy button on this page.

tlaRevision is included as a function in tlaTools.

Copyright © 1993-2005 Thom Little Associates, Ltd. revised 2005.01.01 17:15
One Central Square, Keene, NH 03431-3787 phone 603-357-7567