Jump to content

Mike Torrettinni

Members
  • Content Count

    410
  • Joined

  • Last visited

Community Reputation

39 Excellent

Technical Information

  • Delphi-Version
    Delphi 10.2 Tokyo

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Mike Torrettinni

    Difference between Pred and -1

    OK, I must say that I started using Pred() more and more and I must say I like it, more and more. I re-read the comments above, but I have to say it really looks like High for arrays. I don't see it exotic anymore. This makes sense: for i := 0 to High(aArray) do for i := Low(aArray) to High(aArray) do for i := 0 to Pred(aList.Count) do Reading some comments again was interesting, so if using Pred() means I will never go beyond Delphi beginner level, so be it 🙂
  2. Mike Torrettinni

    Something the comunity should be aware of

    Not me, but it would be nice to hear from anybody who is affected by this change - but you can already see different interpretations of Marco's comment in just a few posts here. I don't see any big change for v7 licensees, they just might be more frequently targeted by email to upgrade, or even charged for download. Expecting any service to work the same (unchanged) after 20 years is a bit over the top, no?
  3. Thanks guys! This was great exercise, a lot of pen and paper to draw out how it should all come together. I have 14 frames, a few Callback functions between them, MainForm is cleaner and doesn't know about frames, so less units exposed. Worked out very well! I even figured how to 'detect' which frame has been refreshed, to focus on correct Tab in PageControl, simple boolean return. This was one of the hardest things, to design classes that are independent, but still have connected hierarchy. I will probably need a few more exercise like this to fully use all the power of classes. I think that is what I have, I just didn't follow those tutorials about Factories, because reading those examples is like reading about Interfaces... all alien to me, at this moment 🙂
  4. for example: If MainForm has 2 frames, Project list and User list - same class/frame, different TProjectDataType... and different actions refresh different frame, something like this: if aAction = actRefreshProjects then for i := 1 to n do if fFrames[i].ProjectDatatype = dtProjList then fFrames[i].Refresh; if aAction = actRefreshUsers then for i := 1 to n do if fFrames[i].ProjectDatatype = dtUsers then fFrames[i].Refresh; In this case MainForm needs to know about TProjectDataType - so it has to use a unit where it is defined. How can I hide TProjectDataType from MainForm?
  5. I have a feature that spans across a few frames and few units. And I have CommonProjectDefinitions.pas where all types and common methods are defined. One of the common types is main data type: TProjectDataType = (dtItems, dtInvoices, dtUsers, dtDocuments, ...); Now I have a MainForm that ads a few Frames as Project data views and each has it's own TProjectDataType. If I want for MainForm to know what datatype each Frame is, I need to use CommonProjectDefinitions.pas in MainForm, Because only the TProjectDataType is used by MainForm (and eventually probably some other units), is this way OK (to expose the whole common unit) or it makes more sense to have CommonProjectDefinitions_Public.pas where all common types that are also used by other forms are defined - so I end up with CommonProjectDefinitions_Public.pas and CommonProjectDefinitions_Internal.pas (which contains everything that doesn't need to be Public). The main concern is to have neatly enclosed units and not everything exposed. Any suggestions or experience what to do in such case?
  6. Mike Torrettinni

    Function with just underscore _() seems to be valid

    Great! Everyday something new 🙂
  7. I noticed this function in gnugettext: function _(const szMsgId: MsgIdString): TranslatedUnicodeString; It seems you can name the methods with just underscore, or even multiple of them: procedure _; procedure ______; Is there any situation when this might trigger some unexpected issues? Wow, Delphi world 🙂
  8. With each iteration I learn something new and which way is appropriate for which implementation. It's fun 🙂
  9. I'm gaining experience, with the mistakes and failures on the way. Rome wasn't built in a day. It shouldn't, but it gives me a little comfort knowing not everybody is perfect and I'm not the only one having odd 'relationship' with the documentation.
  10. When I started with that feature, I had an idea that it would be really easy to plug'n'play other features (I guess like a little framework), but eventually it ended up so customized for specific feature, otherwise I could still be working on it and refactor minor details. I can't wait to get there 🙂 So, I guess you guys are saying documentation and comments and refactoring, there is nothing else that could help with understanding the code at later date.
  11. Mike Torrettinni

    Experience/opinions on FastMM5

    I would say I'm Delphi rookie, so this "heavy multi-threading apps on machines with many CPUs as the memory manager does much less block or serializes the worker threads. E.g. using TParallel"is like sci-fi to me, but if the demos are going to be available for single cpu machines, and no need for in-depth analysis of results to understand them, I would be happy to run a few and be impressed.
  12. Mike Torrettinni

    Experience/opinions on FastMM5

    I tried it in my project, single threaded project, high memory consumption. Tried all optimization options, no improvements over FastMM4. FastMM was a huge improvement over Delphi's memory manager in D2006, for my project, so I'm happy @Pierre le Riche made it available!
  13. What do you mean?
×