Skip to content

Commit 2c40728

Browse files
author
aafent
committed
Finalize wordtest1.bas example program
1 parent fb5b3ad commit 2c40728

6 files changed

Lines changed: 15 additions & 0 deletions

File tree

19 Bytes
Binary file not shown.
46 Bytes
Binary file not shown.

FAST.FBasic.InteractiveConsole/Tests/wordTest1.bas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ PHSdata cnames text ' TextReplacer Library
1616
rem Orchestrate the needed data
1717
print "Load data on demand..."
1818
let AppID=1010 ' Input from the caller application
19+
let Today = date()
1920

2021
foreach cnames
2122
loginfo "Setting up...."+[cnames.ph]

FAST.FBasic.LibraryToolkit/ToolKit/ToolKitHelper.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ public static string FormatStringValue(string placeholder, string value )
6666
}
6767
}
6868

69+
if (modifiers.Contains("D"))
70+
{
71+
// Date: YYYY-MM-DD to DD-MM-YYYY
72+
if (value.Length >= 10 )
73+
{
74+
value = value.Substring(8, 2) + value[4]
75+
+ value.Substring(5,2) + value[4]
76+
+ value.Substring(0,4)
77+
+ value.Substring(10);
78+
}
79+
}
80+
6981
if (modifiers.Contains("U")) value = value.ToUpper();
7082
if (modifiers.Contains("L")) value = value.ToLower();
7183
if (modifiers.Contains("P")) value = ToProperCase(value);

FAST.FBasic.TemplatingLibrary/FBasicTemplatingLibrary.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ private void WordReplaceBody(IInterpreter interpreter)
356356
var replacements=array.ConvertToDictionary<string,string>(0,1);
357357
foreach (var item in replacements)
358358
{
359+
Console.WriteLine(item.Value);
359360
replacements[item.Key] = ToolKitHelper.FormatStringValue(item.Key, interpreter.GetValue(item.Value).ToString());
360361
}
361362
new WordPlaceHolder(placeHolderPrefix,placeHolderSuffix).ReplacePlaceholders(((Stream)stream.Object), replacements, policy);

FAST.FBasicInterpreter/ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ For **Business and Technical** documentation read the [Wiki page](https://github
99

1010
| When | Description |
1111
|------------|--------------------------------------------------------|
12+
| 2025-11-15 | New format specifier D for dates |
1213
| 2025-11-13 | Support for .Net.10.0 |
1314
| 2025-11-03 | New function singlewhite() to Text Replacer Library |
1415
| 2025-11-01 | New Packages versions (Interpreter,Toolkit) |

0 commit comments

Comments
 (0)