George James Software logo

KB0116

Serenji does not Add a Date Stamp to the First Line of a Routine

Applies to: Serenji 2.0 onwards

Issue

Many routine editors add a date and time stamp to the first line of a routine. This is updated whenever a modified version of the routine is saved. This behaviour is not an automatic part of Serenji, because different conventions are typically used on different M platforms.

Solution

This kind of functionality can be added to Serenji by using the custom-coded checks. These are described in more detail in the Serenji help, under Editing, Integrating the Editor with your Development Environment.

The following global node must be set, referencing a user-defined routine. On most server types supported by Serenji, using a %-prefix on the routine name will make it available from all namespaces /UCIs.

set ^%SerenjC("C","SIP-$$PreSave")="PreSave^%ZKB0116"

(Note that the global name is ^%SerenjC not ^%SerenjiC.)

The following code illustrates how to put a simple date stamp and user name onto line 1 in Caché:

%ZKB0116 ; Datestamp the routine in Serenji's save Q PreSave(context) ; N ref S ref=context("Lines") D:$D(@ref@(1)) . N lineone . S lineone=@ref@(1) . S $P(lineone,";",3)=$ZDATE(+$H) . S $P(lineone,";",4)=context("%User") . S @ref@(1)=lineone . S context("Reload")=1 Q ""

Last reviewed: Nov 15, 2004

Back to top