tlaEventSave
Insert Enterprise Standard Date/Time When File is Saved

Visual SlickEdit® - Slick-C Macro - Royalty Free - 2005.01.01 17:15
Send Comments

Purpose

Insert Enterprise Standard Date/Time When File is Saved.

Operation

This function automates the process of adding a date/time stamp to a file.

Before a buffer write occurs, this function is called. If the file being written is one of the module types being date/time stamped, the current date/time is inserted appropriately before the document is written to the file.

This function stamps the current date/time into any comment statement that is of the form:

delimiter yyyy.mm.dd hh:mm when delimiter is set from an entry in a table keyed to the extension of the file.

This function calls tlaDateTime and as such will help implement your organization standard date/time stamp.

It is useful to have a "starter" date/time in the template that you use for module creation. If you use the supplied format emitted by tlaDateTime, an example of a "starter" date/time for C# might be:

// 2002.01.01 12:00      Copyright 1993-2005 ...

The document types (file extensions) currently supported by this function are:

Type Map Comment Revision Language
.adb   /*     Ada
.asm   ;     Assembly Language
.asp   <!--   TRUE Active Server Page
.awk   /*     Aho, Weinberger, and Weinberger
.bas   '     Basic
.bat   /*     Batch (Shell)
.c   //     C
.ctml   /*     CTML
.cls .bas '      
.cob   *     COBOL
.cpp   //     C++
.cs   //     C#
.ctl .bas '      
.cwb   '     AppBasic Macro (CodeWright)
.cxx   //     C++
.dob .bas '      
.dsr .bas '      
.e   //     Slick-C
.frm .bas '      
.h   //     Header (C)
.hpp   //     Header (C++)
.htm .html <!--   TRUE Hyper Text Markup Language
.html   <!--   TRUE Hyper Text Markup Language
.ini   '     Initialization
.hxx .hpp //     Header (C++)
.jav .java //     Java
.java   //     Java
.js   //     Jscript
.jsp   //     Java Server Page
.mac   //     API Macro (CodeWright)
.mak   #     Make and NMake
.nrx   /*     NetRexx
.pag bas '      
.pas   {     Pascal
.php   /*     PHP: Hypertext Preprocessor
.pl   #   TRUE Perl
.rc   /*     RC
.rul   /*     InstallScript
.sqlj   /*     SQLJ
.tcl   /*     Tcl/Tk
.tk   /*     Tcl/Tk
.txt   /*     Text
.v   /*     Verilog
.vb .bas '     Visual Basic
.vbs   '     VBscript
.vhd   /*     VHDL

Special Consideration

There currently is no "exit mechanism" in Visual SlickEdit. Enabling this exit is actually modifying the distributed Visual SlickEdit code.

To enable this exit closely follow the Special Installation instructions below.

Input Parameters / Return Codes

When instaled, renamed and enabled the function save accepts all the input parameters normally passed to save and passes them to the original code that is now rename as tlaWrappedSave. (See Special Installation below.)

Reference

This function calls tlaDateTime.

This function required that you rename save to tlaWrappedSave in macros\files.e. (See Special Installation below.)

Compatibility

Current version verified under:

  • Visual SlickEdit 8.0.0
  • Visual SlickEdit 8.0.1

Special Installation

Perform the following steps:

  • 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 file in Visual SlickEdit with type Slick-C and extension ".e".
  • Issue Ctl-V (paste).
  • Issue Ctl-S (save).
  • DO NOT select PFK-12 to compile the macros at this time.

Then enable the exit:

  • Open the file with the tlaEventSave macros.
  • Rename the function "xxxx" to "save".
  • Issue Ctl-S (save).
  • Open the file "...\macros\files.e".
  • Rename the function "save" to "tlaWrappedSave".
    • Visual SlickEdit 8.0.0 - Line 711.
    • Visual SlickEdit 8.0.1 - Line 724.
  • Issue Ctl-S (save).
  • Select PFK-12 to compile "files.e".
  • Select the window with the tlaEventSave macros.
  • Select PFK-12 to compile the macros.

To later disable the exit:

  • Open the file with the tlaEventSave macros.
  • Rename the function "save" to "xxxx".
  • Issue Ctl-S (save).
  • Open the file "...\macros\files.e".
  • Rename the function "tlaWrappedSave" to "save".
    • Visual SlickEdit 8.0.0 - Line 711.
    • Visual SlickEdit 8.0.1 - Line 724.
  • Issue Ctl-S (save).
  • Select PFK-12 to compile "files.e".

Purchase

tlaSlick is a Visual Slick-C module that contains all of the Slick-C macros on this website in a single easy to install package. The tlaSlick module can be purchased by selecting the Buy button on this page.

tlaEventSave is included as a function in tlaSlick.

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