Jump to content

Anders Melander

Members
  • Content Count

    2563
  • Joined

  • Last visited

  • Days Won

    133

Everything posted by Anders Melander

  1. Anders Melander

    In Case You Didn't Know

    Because 7 bits ought to be enough for everything https://en.wikipedia.org/wiki/Digraphs_and_trigraphs#Pascal
  2. You'll get no complaint from me on that.
  3. Agree. It's a balance, as I'm sure Embarcadero knows and takes into account. Like all evolution, too much change leads to extinction. Too much stability leads to stagnation and obsolescence.
  4. Easy to say when you have already enjoyed the benefit of that backward compatibility.
  5. I'm not sure what it is you disagree with. Optimizing code when there is no need to optimize it is by definition premature optimization. The tool might be able to spot where code can be optimized but it will not be able to spot where that optimization is relevant. For the vast majority of the code I write I make an effort to make the code as readable and verbose as possible, at the cost of performance, because the possible gain of optimization is simply irrelevant. However when I know the code I'm writing is performance critical then I pay attention to what the compiler will do, alignment, loops, implicit finalization, etc., but that's the exception. Of course there are patterns that I have leaned to use regardless of the code being performance sensitive or not (e.g. pass managed types by const). In the cases where I get it wrong, or circumstances changes, then a profiler will tell me exactly where to focus my efforts and, as I said, then it's trivial to correct. I'm not against tools that can spot generic problems but a tool that identifies all cases of function returning managed type, passed as parameter, would be worthless to me. There are better ways of solving that "problem".
  6. Anders Melander

    Large project does not start

    Without knowing anything about your architecture I would say that you need to move the content of each of the tabs into individual frames and then create and destroy these frames on-demand.
  7. Anders Melander

    Catch details on AV

    I don't know but I think in this case it has more to do with limiting the deployment size than with limiting the consumed address space.
  8. Anders Melander

    ANN: Better Translation Manager released

    I think you'll have to debug a bit then. Set a breakpoint on the call to TextToShortcut and trace into it to see what's going wrong.
  9. Anders Melander

    ANN: Better Translation Manager released

    Thanks. That must be the abbreviation of "Steuerung" I guess. Makes sense. The translated RTL resource strings are also available in the ITE translation memory and that is installed regardless of Delphi's language.
  10. Anders Melander

    Manage overloaded IfThen functions

    I think I'll put that on a t-shirt: "Hope - Helping Delphi survive since 1996"
  11. Anders Melander

    ANN: Better Translation Manager released

    You need to translate the sShortcutCopy text in BTM to German and the translated text should use the German key names. I don't know what those are. The key shortcut names are defined in Vcl.Consts: SmkcBkSp = 'BkSp'; SmkcTab = 'Tab'; SmkcEsc = 'Esc'; SmkcEnter = 'Enter'; SmkcSpace = 'Space'; SmkcPgUp = 'PgUp'; SmkcPgDn = 'PgDn'; SmkcEnd = 'End'; SmkcHome = 'Home'; SmkcLeft = 'Left'; SmkcUp = 'Up'; SmkcRight = 'Right'; SmkcDown = 'Down'; SmkcIns = 'Ins'; SmkcDel = 'Del'; SmkcShift = 'Shift+'; SmkcCtrl = 'Ctrl+'; SmkcAlt = 'Alt+'; I.e. find out what SmkcCtrl is translated to in German.
  12. Anders Melander

    ANN: Better Translation Manager released

    I'm not sure what that is supposed to do (I don't read German that good). If the purpose is to translate the texts returned by TextToShortcut then it is unnecessary since the texts are already resourcestrings.
  13. Anders Melander

    ANN: Better Translation Manager released

    You need to swap the order of FixMenuShortcuts and SwitchSoftwareLanguage...
  14. Anders Melander

    Manage overloaded IfThen functions

    What's the point? The arguments would still be evaluated up front. You need the cooperation of the compiler to avoid that.
  15. Anders Melander

    ANN: Better Translation Manager released

    BTM only translates strings and shortcuts are stored in the DFM as integer values. It's really not good practice to translate the shortcuts anyway. For example the user would expect Copy to be Ctrl+C regardless of the language. Instead you can translate the accelerator keys since these are part of the menu text. E.g. &Copy -> Copy = &Kopieren -> Kopieren If you really want to translate the shortcuts, and have BTM handle translation of them, then I'm afraid you'll have to store them in text format as resourcestrings and then use TextToShortCut to convert the text to a shortcut at run time: resourcestring sShortcutCopy = 'Ctrl+C'; begin MenuCopy.ShortCut := TextToShortCut(sShortcutCopy); end;
  16. Yes, I understood that. My point is that searching for this pattern, which is a perfectly normal and valid pattern, would be premature optimization. If there is a performance problem in an application then you analyze the application (for example with a profiler) and locate the hot spots. It is then then easy to identify this pattern in those hot spots just by reading the code. You don't need a tool for that. It's like having a tool for identifying loops because loops are slower than no loops.
  17. Anders Melander

    Catch details on AV

    "Time limited license"... Thanks, but let's not. Also it seems they've opted to keep the map file info separate from the application. I guess that makes sense on mobile due to the size. Not so much on desktop.
  18. It's not that hard to spot. Why would we need a tool for that?
  19. I usually wait until after my morning coffee. Very good point. Few people enjoy watching paint dry - unless it's body paint I have "solved" quite a few performance problems simply by adding a splash screen and/or a progress bars.
  20. Anders Melander

    Drag an Drop

    Well, you shouldn't really be solving that by giving the application full access to everything - but that's a different issue.
  21. Anders Melander

    Catch details on AV

    On Windows you can use an exception logger such as MadExcept or Eurekalog. I don't know of any solutions for maxOS.
  22. Anders Melander

    Drag an Drop

    I have no idea about what that is. You cannot drag between applications running with different elevated privileges (e.g. run as administrator) so make sure that you aren't running Delphi elevated - or disable UAC.
  23. Anders Melander

    ANN: Better Translation Manager released

    There's no difference between ITE and BTM in that regard. They use the exact same RTL mechanism. Ie. the BTM and ITE resource modules are identical. It's only the localization editor/manager/compiler that's different. I believe LoadNewResourceModule used to be in the RichEdit example (no longer included with Delphi but you can find it on the net). Instead you can use LoadResourceModule, in the system unit, or my version of LoadNewResourceModule, in the amLocale unit of the BTM source.
  24. Anders Melander

    ANN: Better Translation Manager released

    Thanks. Please read the last part of the answer for info on controlling the active language: ...But be aware that once a form has been created (and thus the DFM loaded from the resource module) you will need to either recreate the form or reload it from the DFM resource (not recommended) in order for it to use the new language.
  25. Anders Melander

    Primary Key on FDMemTable

    I believe you're thinking of the pfInKey value of TField.ProviderFlags. <rant>I know the help has improved but why the hell isn't there a link in the help from the ProviderFlags property to the type of the property. Don't they have computers that can do this stuff for them?</rant>
×