Jump to content

dormky

Members
  • Content Count

    81
  • Joined

  • Last visited

Everything posted by dormky

  1. When I build .dcu files, they often aren't the same size. Does anyone know why that is ? I literally just build two times in a row, and between 5 and 10% of .dcu will have a size difference of a few dozen bytes. I'm trying to apply formatting to the whole project and want to verify that the output is not affected (trust but verify, heh ?) but if building the same thing twice already leads to significant changes this will be quite difficult to achieve... And yes, we have 0 test coverage. Edit : Example with this small file, where 4 bytes are added at around 3/4ths of the file. UConfigEchelle_big.dcu UConfigEchelle_small.dcu
  2. Ah, it might be the debug info indeed for the big changes when formatting. But there's still differences when compiling 2 times in a row, which I can't explain (see attached files in the OP)
  3. Well, I just checked on the effects of formatting on .dcu files and they seem to be affected a lot. Very strange that intermediate compiler files would be affected by formatting. Does delphi output other intermediate files that I could check ?
  4. I'd like to extract a row's data as an object from a TMyQuery, so that I can give it as an argument to a function. But I don't see anything that can achieve that in the doc. For background, this is using MyAccess to grab from a MySQL DB. Typically I'd like to have something like MyQuery.First(); DataObject := MyQuery.CurrentData(); MyQuery.Next(); // DataObject still has the data from the previous row
  5. DataSetHelper does indeed seem to be what I'm looking for ! Too bad I'm almost finished writing the RTTI solution described just above by Lars, which I suppose is what DataSetHelper is doing. Writing it myself was what i wanted to avoid, but alas. Since I've written tests for it I'll use my code, but thanks for coming though anyway ๐Ÿ™‚
  6. I'd like to create a TValue that holds a TBytes array. From what I see of TValue's code, it doesn't seem to be designed for such, even by using variants. Alternatively, if I can just get a pointer to the relevant instance field from TRttiField and cast it to a TBytes, that'll work too.
  7. dormky

    How do I make a TValue for TBytes ?

    Damnit, the debugger is showing the error on the wrong line. I had an invalid typecast, but in the next block of code... Thanks :')
  8. I had two version of RAD Studio installed. 10.3 under license, 11 under free trial. I uninstalled 11, and now 10.3 doesn't work anymore (no debugging). I'd like to re-install it, but can't find the installer anywhere on Embarcadero's website. There's only the free trial.
  9. I'm trying to have the dialogs like MessageDlg be translated. Looking at the code in Vcl.Dialogs, it uses the LoadResString function to get the string for the buttons. It doesn't look like it can handled multiple sources for the same string, but I could be wrong because it would be kind of insane to force dialogs to be in one language only. But this is Delphi, they aren't known for making logical design decisions.
  10. dormky

    BringToFront alternative

    The following code shows that BringToFront does not work. Are there any alternatives I can use to put a control on top of all other controls in a window ? interface uses Vcl.Forms, Vcl.ComCtrls, System.Classes, Vcl.Controls, Vcl.StdCtrls, UUtils, Vcl.ExtCtrls; type TFormMain = class(TForm) PageControlMain: TPageControl; Sheet1: TTabSheet; Button1: TButton; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private dynLabel: TLabel; end; var FormMain: TFormMain; implementation {$R *.dfm} procedure TFormMain.Button1Click(Sender: TObject); begin dynLabel.BringToFront(); end; procedure TFormMain.FormCreate(Sender: TObject); begin dynLabel := TLabel.Create(self); dynLabel.Parent := self; dynLabel.Height := 200; dynLabel.Width := 500; dynLabel.Top := 100; dynLabel.Left := 100; dynLabel.Caption := 'BAMKLJDOUZEHFOZEI'; dynLabel.Visible := True; dynLabel.BringToFront(); end;
  11. dormky

    Visually edit a custom component

    Hello, I have a series of 4 numbers describing current atmospheric conditions, currently shown in a TGroupBox with each number in a TEdit. I'd like to encapsulate the behavior related to these numbers (color changes) into a component so I can re-use it in multiple places. I've created a new component based on TGroupBox, but when opening it there's no Design tab, and I don't want to use code to describe the UI as this runs opposite to what is generally done in Delphi (where you use a graphic UI editor). How can I get my custom TGroupBox component in a Design tab so I can edit it (with a .dfm) ?
  12. dormky

    Visually edit a custom component

    Frames look great, thank you for sharing !
  13. dormky

    BringToFront alternative

    The TLabel was just for demonstration purposes, I'd like to be able to do that with all components...
  14. dormky

    BringToFront alternative

    I don't want to change anything about other controls, I just need a control to be on top of all others. Yes, that's why I'm looking for an alternative. Do you know of any component that could work on the same group as my TPageControl here ? I suppose I could use such a component, make it invisible but keep a child control of it visible, if that's possible.
  15. dormky

    MyDAC : Unknown column error

    I have a TMyTable on which I've just added a field called "FileVersion" using right-click on the control, right-click again and "New Field". When I log all the fields in "MyTable.Fields.FieldName", FileVersion does indeed exist. But when setting the table's "Active" property, I get the following error : #42S22Unknown column 'FILEVERSION' in 'field list' I honestly have no idea what I'm supposed to do here ? Looking at other fields in that table, they all look the exact same. They all exist in the exact same places (in the dfm file and the code).
  16. dormky

    GIF not playing in Delphi 10.3

    It doesn't adapt the image size to the control size. Mods, please delete this post ๐Ÿ™‚
  17. dormky

    MyDAC : Unknown column error

    It's because with the default connection parameters, it was connecting to the production database. Which of course did not have the added column. Don't ask me why this is done by default at design time, I inherited this project...
  18. dormky

    MyDAC : Unknown column error

    Alright, so it turns out that when compiling with the DEBUG flag, all components keep the csDesigning flag in their ComponentState, leading MyDAC to connect automatically to whatever is set at design time. How can I prevent this ? Apparently SetDesigning cannot be called manually (it's protected) but of course a helper class gets around that easily. Still, I'd rather have a solution that doesn't rely on these kind of shenanigans.
  19. dormky

    MyDAC : Unknown column error

    Every field is shown in all caps in errors ; MySQL doesn't care about that anyway. And yes, I did add it in the database. And I only have one database.
  20. TMyRecord = record myArray: array [0..1] of Integer; end; The Delphi compiler seemingly does not generate runtime type information for "myArray". This seems strange, as : TMyRecord = record myRecord: record myint: Integer; end; end; Here "myRecord" will get RTTI generated, with a name such as "TMyRecord:1". TRttiArrayType exists to represent array types, but seemingly the decision was made to just... not use it ? What's the technical reason behind the refusal to generate RTTI for this case ? It seems everything is there to do it, and the compiler just... doesn't. From an outside perpective, is seems it would be exceedingly easy to implement.
  21. dormky

    How do I tab into a TDBRadioGroup ?

    I have a TDBRadioGroup with 2 options. Unfortunately, when pressing TAB to go from field to field, when it gets to the TDBRadioGroup you can't edit the values via keyboard. I tried space, enter and arrows, all with shift and ctrl. What's the deal here ? Is there no way to actually give the focus to this type of field and edit it via keyboard ? The TabOrder is correct and TabStop is True. Strangely enough, once you've clicked on an option it suddenly becomes available in the TAB navigation, and at the expected order. Not sure what's happening here, is it because there is no default value (none of the options are selected at first) ?
  22. dormky

    How do I tab into a TDBRadioGroup ?

    It's a VARCHAR(1), for the sex. The default value is empty, so none of the values are checked, which makes sense.
  23. I have a build configuration that includes EurekaLog. Since EurekaLogs alone takes 15s of the build process I'd like a debug config where it's not enabled. However I can't find anywhere in the IDE allowing me to duplicate a build configuration. You can export/import options, but not entire build configurations. Is that even something possible ?
  24. Ooooh I just realized you create the new config by right-clicking an existing one, not the "Build Configuration". Very cool, that works too and is much cleaner. Thanks !
  25. > I assume you mean runtime warnings from custom code, and not thousands ๏ปฟof compile time warnings? Nope, it's compile time warnings about string casts and the likes. Since a lot of the code is copy-pasted for each slightly different case, the warnings are too so there's really a lot of them ^^ The problem with creating a new configuration is that I lose the settings of the original config. We have things like a custom stack size, so I want to have the exact same config except for the Eurekalog flag and the warnings/hints. I just figured I could edit the .proj directly to make sure the configs are the exact same and it seems to be fine ๐Ÿ™‚
ร—