I think you should have a look at this documentation on strings,
particularly for PChar :
https://www.freepascal.org/docs-html/ref/refsu9.html
Le 20/06/2021 à 02:09, James Richters a écrit :
DefaultFileName: AnsiString = '' ;
So Length(DefaultFileName) = 0
TFileName.nMaxFile:=Max_Path+1;
Thi
On 6/19/21 9:40 AM, Bo Berglund via fpc-pascal wrote:
Strange name of a function, though, is that needed?
idk why the specific name was selected but you need some easy way to add leading
zeros if you want them... some might complain about the conversion from integer
to string, though... i've
Le 19/06/2021 à 15:40, Bo Berglund via fpc-pascal a écrit :
function _2d( _i: Integer): String;
Strange name of a function, though, is that needed?
No, it's not needed, it's just my odd way of naming ... ;-) (the closer
to %.2d ).
___
fpc-pascal mai
It's curious, I'm not completely sure we are reasoning about the same
function and record.
You mention TFileName but for me in FPC 3.2.0:
- TFileName is declared as "TFileName= type string;" in sysutilh.inc.
- OPENFILENAMEA is declared as record in CommDlg.pp line 94
and TOPENFILENAMEA=OPEN
On Fri, 18 Jun 2021 18:13:52 +0200, Jean SUZINEAU via fpc-pascal
wrote:
>
>function _2d( _i: Integer): String;
>begin
> Str( _i, _2d);
> if Length(_2d) < 2 then _2d:= '0'+_2d;
>
>end;
Thanks,
it seems like this gets rid of the Format call, which probably brings in a lot
of un-needed st