While working on the Android2DelphiImport tool, I had to get strings converted into the PAnsiChar format.
A little known record, TMarshaller, in System.SysUtils helped. It has various methods to deal with string conversions and memory allocation, and when your method exits, it cleans up the memory for you as well.
Here's how I got my PAnsiChar.
var M: TMarshaller; P: Pointer; begin ... ... P := M.AsAnsi('We are about to be converted into a PChar').ToPointer; // P is now a PAnsiChar // Similarly, to get a UTF8String, M.AsUtf8('Use the source!').ToPointer; end;
Thanks that helped me! Keep posting, it really helps !
In 2017, with the release of Delphi 10.2 Tokyo, Embarcadero introduced a specialized implementation of the Observer pattern into the System.Classes unit. While it has been in the wild for 9 years, it remains a "hidden" architecture for many, primarily because it serves as the invisible engine behind LiveBindings. Other than live bindings, you can also use the Observer pattern as a way to update component settings to the Windows registry, an .ini file, or persist it elsewhere.
System.Classes