Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: pre-processor symbol when FPC symbol is defined/used
« Last post by paule32 on Today at 05:11:35 pm »
Thank you. This works like a charm  ;D
2
Yes, I know that.
In that case sorry for being a redundant remark. I wasn't sure whether or not you did,

There is no reason to apologize. Everything is OK. This information can be used by someone else who doesn't know it and is browsing the forum.

But I believe this:

in Fpc and ObjFpc modes it should be disabled by default.
The way these kind of things work is usually a mystery to me. Might even be debatable what is the 'correct' way to do it but experience in the past have shown there always seem to be a (valid) reason for having chosen the approach as (currently) implemented.

Indeed, it may be so. Sometimes, after a longer period of time, certain shortcomings of the solution used may become apparent.
3
General / Re: How can i make this window ?
« Last post by TRon on Today at 05:06:35 pm »
On a windows machine IIRC the colors would be controlled by OS.
Oh, I hadn't thought of that one.

There seem to be system theme management going on inside a hintwindow (I do not know if it is active by default) so you might be right there.

In which case, 2 out of 3 is also not bad though I understand that is not what TS is looking for :-)

I rather wait with further suggestions until all specs are on the table... TS seem to have a habit of adding additional requirements as suggestions go along and I am not in the mood for these games with crystal balls right now.

AFAIK there is not a ready to go component/solution that does exactly as TS seem to want and I am currently trying to avoid suggesting to use a video playback component to literally provide what TS asks for  O:-)
4
I get the error with 0-bit reloc when trying to compile with -shared
When just using "x86_64-w64-mingw32-ld  --gc-sections --oformat pei-x86-64 uefimain.o uefi.o system.o -e efi_main -o MAIN.EFI link.lds" it works fine

Why does it need to be relocatable? As far as I can tell the Win64 code generates position independent code by default, but I'm not an expert on Windows stuff
6
Using for in syntax for an array seems unnecessary and probably should not have been implemented. It makes sense for a set where items are in no particular order . I wonder why they added this bloated feature? Is it for delphi compatibility or something?

No, it's not unnecessary. This is absolutely useful. And it's good that it was implemented. I agree with what CCRDude wrote:

Is there any good reason to use for.. in to iterate through an array instead of using a for loop with index? I’m only familiar with using for.. in in the context of things like sets where the number of items is unknown. I’ve also seen it used for fields in an sql dataset.

Abstraction of iteration?
Prevent errors through wrong index, especially with nested loops?
Less defined local variables (the index) improves readability of function head?
Readability in the iteration itself?

Code: [Select]
for i := 0 to Pred(Length(A)) do begin
   item := A[i];
   item.DoSomething;
end;

for i := 0 to Pred(Length(A)) do begin
   A[i].DoSomething;
end;

for item in A do begin
   item.DoSomething;
end;

This is useful not only for sets and arrays, but also for strings, lists, collections, and similar iterable objects.
7
Cookies are a bad idea in the first place. And not necessary.
8
Yes, I know that.
In that case sorry for being a redundant remark. I wasn't sure whether or not you did,

Quote
And I agree that:

But I believe this:

in Fpc and ObjFpc modes it should be disabled by default.
The way these kind of things work is usually a mystery to me. Might even be debatable what is the 'correct' way to do it but experience in the past have shown there always seem to be a (valid) reason for having chosen the approach as (currently) implemented.
9
General / Re: CORBA interface and Variants
« Last post by JdeHaan on Today at 04:56:48 pm »
I know it's not optimal to use Corba interfaces.
But, the problem I was facing was that in order to use a COM interface, my class definition had to inherit from TInterfacedObject, but I also had to inherit from another class. To prevent that I used Corba.
I'm now thinking of creating my own value type, based on a variant record instead of a Variant type. So, basically:

Code: Pascal  [Select][+][-]
  1. type
  2.   TMyRec = record
  3.     case byte of
  4.      0: (IntVal: Integer);
  5.      1: (FloatVal: Real);
  6.      2: (IntfVal: IMyCorbaInterface);
  7.   end;
  8.  
 
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018