Changeset 204 for trunk/tools


Ignore:
Timestamp:
Jun 3, 2020, 5:36:55 PM (5 years ago)
Author:
David Azarewicz
Message:

Variable name changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/AddToFile.cmd

    r200 r204  
    33 * Written by and Copyright (c) 2010-2018 David Azarewicz http://88watts.net
    44 *
    5  * @#D Azarewicz:1.02#@##1## 15 Nov 2018              DAZAR1    ::::::@@AddToFile.cmd (c) David Azarewicz 2018
     5 * @#D Azarewicz:1.03#@##1## 02 Mar 2020              DAZAR1    ::::::@@AddToFile.cmd (c) David Azarewicz 2020
    66 * V1.01 16-Sep-2016 First official release
    77 * V1.02 02-Jun-2017 Added Asd to bldlevel, added DATE1
     8 * V1.03 02-Mar-2020 Added STRING function
    89 *
    910 * The following line is for the help sample code for the VAR function:
     
    2728  Say '  VERSIONMINOR - Adds the minor portion of the provided version number.';
    2829  Say '  VERSIONREVISION - Adds the revision portion of the provided version number.';
     30  Say '  STRING - Adds the string with %Y substitution.';
    2931  Say '  VAR - Adds the value of the specified variable from a specified file.';
    3032  Say '  FILE - Adds the contents of a file.';
     
    6062  call 'AddToFile.cmd' MyCmd;
    6163  MyCmd=MyFile||',#define DVREV,VERSIONREVISION,1.2.3';
     64  rc=LineOut(MyFile, '--- AddToFile.cmd '||MyCmd);
     65  call 'AddToFile.cmd' MyCmd;
     66  MyCmd=MyFile||',#define DSTRING,STRING,The year is %Y';
    6267  rc=LineOut(MyFile, '--- AddToFile.cmd '||MyCmd);
    6368  call 'AddToFile.cmd' MyCmd;
     
    183188    if (RepLoc>0) then OutStr=Substr(String,1,RepLoc-1)||NewStr||Substr(String,RepLoc+2);
    184189    else OutStr=String||' '||NewStr;
     190    rc=lineout(OutFile, OutStr);
     191    rc=lineout(OutFile);
     192  end
     193
     194  when (Function="STRING") then do
     195    RepLoc=Pos('%Y', Parm1);
     196    if (RepLoc>0) then do
     197      Parm1=Substr(Parm1,1,RepLoc-1)||FORMAT(SUBSTR(DATE('S'), 1, 4))||Substr(Parm1,RepLoc+2);
     198    end
     199    RepLoc=Pos('%A', String);
     200    if (RepLoc>0) then OutStr=Substr(String,1,RepLoc-1)||Parm1||Substr(String,RepLoc+2);
     201    else OutStr=String||' '||Parm1;
    185202    rc=lineout(OutFile, OutStr);
    186203    rc=lineout(OutFile);
Note: See TracChangeset for help on using the changeset viewer.