[Pas2js] ExtractFileName function

Michael Van Canneyt michael at freepascal.org
Wed Jul 31 21:12:01 CEST 2019


Can you please tell us what the issue is, give a sample program that
demonstrates it ?

These functions come from the FPC RTL, if there was an issue, it would
probably have been reported a long time ago ?

Michael.

On Wed, 31 Jul 2019, warleyalex via Pas2js wrote:

> There are an issue on the ExtractFileName function | win64 platform
>
> ...an workaround would be:
>
> function ExtractFileName(str: String): String;
> begin
>  asm
>    Result = str.split('\\').pop().split('/').pop();
>  end;
> end;
>
> function ExtractFileNameWithoutExt(str: String): String;
> begin
>  asm
>    Result = str.split('\\').pop().split('/').pop().split('.')[0];
>  end;
> end;
>
>
>
>
>
> --
> Sent from: http://pas2js.38893.n8.nabble.com/
> _______________________________________________
> Pas2js maillist  -  Pas2js at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js


More information about the Pas2js mailing list