Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exist any Delphi RTL function equivalent to swscanf

I'm looking for RTL delphi function equivalent to the sscanf/swscanf C++ functions. Exist something like that in the RTL delphi functions or I must look for a third-party implementation?

like image 868
Salvador Avatar asked Aug 08 '26 15:08

Salvador


2 Answers

I personally would simply call the real functions which can be imported from msvcrt.dll.

function sscanf(buffer, format: PAnsiChar): Integer; 
    cdecl; varargs; external 'msvcrt.dll';
function swscanf(buffer, format: PWideChar): Integer; 
    cdecl; varargs; external 'msvcrt.dll';

These are tried and tested robust implementations of the C standard library functions.

like image 111
David Heffernan Avatar answered Aug 11 '26 00:08

David Heffernan


You can download Scan function for Delphi, which is ported MSVC RTL function.

like image 34
da-soft Avatar answered Aug 10 '26 22:08

da-soft



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!