Coming up in TMS FNC Core

  

Working hard!
We are working hard on getting TMS FNC Core ready for the next update. It will include the TTMSFNCWebBrowser component that will support the latest browser technologies on various platforms. Microsoft replacing Internet Explorer/Edge with Edge Chromium (https://www.theverge.com/2018/12/4/18125238/microsoft-chrome-browser-windows-10-edge-chromium). Apple is forcing applications to switch to WKWebView for both macOS and iOS from April 2020 (https://developer.apple.com/news/?id=12232019b). For us, this was a signal to quickly start implementing these browser changes and make sure we offer the latest technologies Microsoft and Apple are pushing out. Choosing the TTMSFNCWebBrowser instead of the default TWebBrowser will offer you the best experience and worry-free applications for the future.

Windows: Edge Chromium
macOS/iOS: WKWebView
Android: WebView

All of the above operating systems are supported through various frameworks: FMX, LCL, VCL and WEB

On the WEB it acts as a DIV which can load and handle HTML, execute JavaScript and many more.

That's not all!
Which each update of TMS FNC Core or other FNC products, we tend to add little gems hidden inside. The most important units that bundle all these little gems are *TMSFNCUtils.pas and *TMSFNCTypes.pas (* = FMX., VCL., WEBLib., LCL). For this blog, I wanted to point out a very nice class helper that allows you to generate JSON from an object, store/restore it, save it to a file or stream and even log it inside the debug console.

TTMSFNCObjectHelper = class helper for TObject
function ToJSON(AExcludedProperties: TTMSFNCObjectExcludePropertyListArray): string; overload;
function ToJSON: string; overload;
procedure FromJSON(const Value: string);
property JSON: string read ToJSON write FromJSON;
procedure Log;
{$IFNDEF WEBLIB}
procedure SaveToJSONFile(const AFileName: string);
procedure LoadFromJSONFile(const AFileName: string);
{$ENDIF}
procedure SaveToJSONStream(const AStream: TStream);
procedure LoadFromJSONStream(const AStream: TStream);
end;

This class helper will allow you to take any TObject descendant and generate JSON from it. Below is a little sample that demonstrates this.
TTestClass = class(TPersistent)
private
FB: string;
FC: Double;
FA: Boolean;
published
property A: Boolean read FA;
property B: string read FB write FB;
property C: Double read FC write FC;
end;
var
t: TTestClass;
begin
t := TTestClass.Create;
t.FA := True;
t.FB := 'Hello World!';
t.FC := 123.456;

t.JSON.Log;
end;
Debug Output: {“$type”:”TTestClass”,”A”:true,”B”:”Hello World!”,”C”:123.456} Process Project1.exe (6968)
A little more patience
As already mentioned we are working hard on the update. There are a few things that need some more testing but as soon as that's ready the update will be released. We are eager to find out which components, libraries & little gems you are using inside your application, so you can always showcase that through email support.

Comments are closed.