-
Content Count
2563 -
Joined
-
Last visited
-
Days Won
133
Everything posted by Anders Melander
-
Because 7 bits ought to be enough for everything https://en.wikipedia.org/wiki/Digraphs_and_trigraphs#Pascal
-
Micro optimization - effect of defined and not used local variables
Anders Melander replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
You'll get no complaint from me on that. -
Micro optimization - effect of defined and not used local variables
Anders Melander replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
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. -
Micro optimization - effect of defined and not used local variables
Anders Melander replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Easy to say when you have already enjoyed the benefit of that backward compatibility. -
Micro optimization - effect of defined and not used local variables
Anders Melander replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
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". -
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.
-
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.
-
ANN: Better Translation Manager released
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
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. -
ANN: Better Translation Manager released
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
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. -
Manage overloaded IfThen functions
Anders Melander replied to Mike Torrettinni's topic in General Help
I think I'll put that on a t-shirt: "Hope - Helping Delphi survive since 1996" -
ANN: Better Translation Manager released
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
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. -
ANN: Better Translation Manager released
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
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. -
ANN: Better Translation Manager released
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
You need to swap the order of FixMenuShortcuts and SwitchSoftwareLanguage... -
Manage overloaded IfThen functions
Anders Melander replied to Mike Torrettinni's topic in General Help
What's the point? The arguments would still be evaluated up front. You need the cooperation of the compiler to avoid that. -
ANN: Better Translation Manager released
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
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; -
Micro optimization - effect of defined and not used local variables
Anders Melander replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
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. -
"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.
-
Micro optimization - effect of defined and not used local variables
Anders Melander replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
It's not that hard to spot. Why would we need a tool for that? -
How to optimize exe loading times
Anders Melander replied to a topic in Software Testing and Quality Assurance
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. -
Well, you shouldn't really be solving that by giving the application full access to everything - but that's a different issue.
-
On Windows you can use an exception logger such as MadExcept or Eurekalog. I don't know of any solutions for maxOS.
-
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.
-
ANN: Better Translation Manager released
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
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. -
ANN: Better Translation Manager released
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
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. -
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>