On Fri, 16 Jun 2023 20:51:42 +0700
Hairy Pixels via fpc-pascal wrote:
> > On Jun 16, 2023, at 6:23 PM, Thomas Kurz via fpc-pascal
> > wrote:
> >
> > Whether it's elegant is a different question. In my opinion YES
> > because it often gives better readable code than nested "if"
> > statements in
> On Jun 16, 2023, at 6:23 PM, Thomas Kurz via fpc-pascal
> wrote:
>
> Whether it's elegant is a different question. In my opinion YES because it
> often gives better readable code than nested "if" statements inside the loop.
> But I've also read that using "break" is discouraged because it
Il 16/06/23 15:02, Tomas Hajny via fpc-pascal ha scritto:
If you compile with -CO, you should get at least a hint (if you enable
displaying them, of course):
I believed that -Co was enough. I'll add -CO to the debug options.
Thanks.
Giuliano
___
On 2023-06-16 13:46, Giuliano Colla via fpc-pascal wrote:
Il 16/06/23 13:36, Peter B via fpc-pascal ha scritto:
Yes. Assigning a 64bit integer to a 32bit one is fine as long as the
range is within bounds.
Range of a variable can only be checked at run time.
I can understand that. But the com
Il 16/06/23 13:36, Peter B via fpc-pascal ha scritto:
Yes. Assigning a 64bit integer to a 32bit one is fine as long as the
range is within bounds.
Range of a variable can only be checked at run time.
I can understand that. But the compiler generates quite a number of
warning for potential lo
On 16/06/2023 11:55, Giuliano Colla via fpc-pascal wrote:
Is that the intended behavior of compiler?
Yes. Assigning a 64bit integer to a 32bit one is fine as long as the range is
within bounds.
Range of a variable can only be checked at run time.
___
I'm certainly not the expert in FPC's details, so maybe there'll you'll get a
better answer. I just tell you my point of view.
>> It's an array with a terminator
>>string? Probably the length of the array should be set instead of
>>doing string compares every loop.
>
> I need to set it in the var
I made a stupid error. My code:
TFileObj = Class(TObject)
[snip]
Size: Integer;
[snip]
end;
procedure TForm1.FillDir(FileData : TSearchRec);
...
FFIleObj.Size := FileData.Size;
...
but TSearchRec structure is:
TRawbyteSearchRec = Record
[snip]
Size : Int64;