[fpc-pascal] Directory Tree
James Richters
james.richters at productionautomation.net
Sat Apr 24 16:01:19 CEST 2021
I was able to fix the spacing on the PDF file so there are no more gaps between the box characters.
I had to change both:
DB.Layout.Height:=4; // 0.4 cm.
DB.StretchMode:=smDontStretch;
So now that the PDF file looks correct, I don’t need the open office document because it never needs to be editable.
I have a date time routine for one of my big console projects that displays days, hours, minutes and seconds and takes off any leading zeros for days and hours from a date/time variable. I’ll see if I can bring that routine over and get it to work.
James
From: fpc-pascal <fpc-pascal-bounces at lists.freepascal.org> On Behalf Of Jean SUZINEAU via fpc-pascal
Sent: Saturday, April 24, 2021 9:39 AM
To: fpc-pascal at lists.freepascal.org
Cc: Jean SUZINEAU <jean.suzineau at wanadoo.fr>
Subject: Re: [fpc-pascal] Directory Tree
Le 23/04/2021 à 19:56, James Richters via fpc-pascal a écrit :
Get Checked or Selected works great, but if I push it twice, the second time I get:
Unable to open file
C:\Users\James\AppData\Local\Temp\FiC152.odt
But I did make sure to close word and the PDF file before pushing it a second time.
Yes, it's a very interesting bug that I'm currently investigating. May be I don't use the temp directory correctly.
When making the output, I start by copying the template file to another filename/filepath.
When I use my code to generate the new filename in the temp directory (Nom:= OD_Temporaire.Nouveau_ODT(Prefixe);),
on the second time, the system doesn't find the source file for the copy ('FileVirtualTree_txt_to_odt.odt') and the copy fails.
But the source file isn't deleted, it continues to be visible in File Explorer, you can open it in LibreOffice.
And this happens either if , instead of using the CopyFile from lazutils/FileUtils.pas, I use a home made "MyCopyFile" function coded with BlockRead/BlockWrite or even using command line cmd.exe / xcopy to do the job.
But if I copy the template to a file in the exe directory (just Nom:= 'temp_'+IntToStr(temp)+'.odt'; Inc(temp);), it works ...
I tried to change formatDateTime to include Days, because many selections go well over 24 hours and it was just leaving the days off... so instead of showing 2days, 3:14:54 it’s just showing 3:14:54
So I changed format date to d:h:m:s but for some reason the totals of the branches are coming up with 30 days even though the totals are nowhere near even one day. I don’t see where the 30 days could possibly be coming from.
I didn't had time to work on this for now. I think it's a bit too much complicated for FormatDateTime, it would be safer to decode the datetime value in a special function (something like days:= int(datetime); hours:= frac(datetime)*24; minutes:= frac(hours)*60 ... )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20210424/3f784664/attachment-0001.htm>
More information about the fpc-pascal
mailing list