Changeset 204 for trunk/tools
- Timestamp:
- Jun 3, 2020, 5:36:55 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/AddToFile.cmd
r200 r204 3 3 * Written by and Copyright (c) 2010-2018 David Azarewicz http://88watts.net 4 4 * 5 * @#D Azarewicz:1.0 2#@##1## 15 Nov 2018 DAZAR1 ::::::@@AddToFile.cmd (c) David Azarewicz 20185 * @#D Azarewicz:1.03#@##1## 02 Mar 2020 DAZAR1 ::::::@@AddToFile.cmd (c) David Azarewicz 2020 6 6 * V1.01 16-Sep-2016 First official release 7 7 * V1.02 02-Jun-2017 Added Asd to bldlevel, added DATE1 8 * V1.03 02-Mar-2020 Added STRING function 8 9 * 9 10 * The following line is for the help sample code for the VAR function: … … 27 28 Say ' VERSIONMINOR - Adds the minor portion of the provided version number.'; 28 29 Say ' VERSIONREVISION - Adds the revision portion of the provided version number.'; 30 Say ' STRING - Adds the string with %Y substitution.'; 29 31 Say ' VAR - Adds the value of the specified variable from a specified file.'; 30 32 Say ' FILE - Adds the contents of a file.'; … … 60 62 call 'AddToFile.cmd' MyCmd; 61 63 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'; 62 67 rc=LineOut(MyFile, '--- AddToFile.cmd '||MyCmd); 63 68 call 'AddToFile.cmd' MyCmd; … … 183 188 if (RepLoc>0) then OutStr=Substr(String,1,RepLoc-1)||NewStr||Substr(String,RepLoc+2); 184 189 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; 185 202 rc=lineout(OutFile, OutStr); 186 203 rc=lineout(OutFile);
Note:
See TracChangeset
for help on using the changeset viewer.