Hello.
I Improved the code based in Thaddy and ASerge(Awesome insights in your attached file) suggestions:
-Replaced 'var' by 'const'
-Moved 'FormatSettings' initialization to 'tkFloat' case.
-Removed useless string concatenations.
-Removed the need for the 'TypeData' variable.
-Added ifdef to handle a name change in trunk (ManagedFldCount to TotalFieldCount).
Tried to add the generic version but it dont compiled in 3.0.4 (i am not a trunk user for now).
I am thinking about the inclusion of custom formatting but there's just too many options:
- Integers can be binary, octal or hexadecimal hexadecimal...
- Floats already have formatsettings...
- Booleans can be 0 or 1 ou true or false...
- Custom delimitters
My main inspiration to write this was 'console.log' in javascript or python 'print' and there's no way to format the output in this functions (as they are used for logging and debugging, not serialization). I think that cases where this type of fine tuning is needed you cant escape but write your own ToString in a TypeHelper or advanced record or whatever...
https://github.com/correaelias/TypeUtils