Go to:  Davar site entry | Site contents | Site index | Mainframe | PDF | Text bottom

DT  PDF/Edit  Macro

        

DT PDF/Edit macro is used to change text modification date to the current date and is basically a keystroke saver (mainly in terms of cursor positioning).  DT macro is entered in the COMMAND field of PDF/Edit session.

I have a habit of preceding most of the texts with an underlined title (see DT macro text below as an example).  First line of a title contains text creation and text last modification dates.  This modification date is changed to the current date when text contents get modified, thus making it easy to determine which version of one and the same text is more recent than the other[s].  DT macro simplifies this otherwise manual operation.

DT can be set as an initial macro (IMACRO) in the Edit profile to make date modification fully automatic (if date is not found in the first line of a text nothing gets modified).  However this implies that every Edit session entry ends up in editing something, which is not always the case.

DT macro text is pretty much self-explanatory:
 • Current date is obtained from the &SYSDATE CList system variable and is formatted (century is hard-coded).
 • First text line is assigned to a variable and text bounds are retrieved from the Edit profile and assigned to corresponding variables.
 • Text of the first line is scanned from right to left in search of the '/' — date delimiter.
 • If date delimiter is found, date initial position is set and formatted current date overlays modification date field in the the first line the text being edited.
 • Session is reset and screen is positioned to the top of the text.



     /* DT  Change Text Editing Date to Current One    10/16/1989–01/03/2000
     /* --------------------------------------------------------------------
     /* Copyright (C) 1989–2000 by Vladimir Veytsel            www.davar.net

        CONTROL NOCAPS
     /* CONTROL NOCAPS,SYMLIST,CONLIST,LIST,MSG

        ISREDIT MACRO

           SET Date=&STR(&SUBSTR(1:2,&SYSDATE)/+
                         &SUBSTR(4:5,&SYSDATE)/+
                       20&SUBSTR(7:8,&SYSDATE))
     /*                **  - Current century

           ISREDIT (String)     = LINE 1
           ISREDIT (Left,Right) = BOUNDS

           DO &I=&Right TO 25 BY -1
              IF (&SUBSTR(&I,&String)=&STR(/)) +
                 THEN DO
                         SET I=&I-5
                         ISREDIT LINE 1 = LINE + <&I,&Date>
                         GOTO Finish
                      END
           END

           Finish:  +
              ISREDIT RESET
              ISREDIT UP MAX

        EXIT CODE(1)
  

View [and save] DT.CLS text   (Use [Back] button or [Alt]+[CL] to return here)
Go to:  Davar site entry | Site contents | Site index | Mainframe | PDF | Text top