Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 05/17/24 in Posts

  1. Usually, yes! Peganza Pascal Analyzer even has a report for that:
  2. Kazantsev Alexey

    Delphi Parser/Compiler Limitation?

    Use ampersand operator, Luke. program Project2; {$APPTYPE CONSOLE} uses System.TypInfo; {$SCOPEDENUMS ON} type TEnums = (&TRY, &SHR, &XOR, &IS, &AS); begin WriteLn(GetEnumName(TypeInfo(TEnums), Ord(TEnums.SHR))); WriteLn(GetEnumValue(TypeInfo(TEnums), 'shr')); ReadLn; end. Output: SHR 1
  3. Roger Cigol

    XML File - I need a schema for this file

    Wow! super fast response. I wasn't aware of that useful site - so thanks for the link. I will try this xsd and see how I get on.... Thank you Lars.
  4. dummzeuch

    What is the best AI at Delphi

    You have listed chatGPT. Which version(s) were you using? My own experience is that neither the free chatGPT nor Gemini are any good for producing Delphi code. I haven't tried any others.
  5. Stefan Glienke

    What do you think of "Local Global variables"

    While I at times use local routines I avoid accessing outer scope local variables like the plaque because it usually generates quite a huge and often unnecessary stack frame.
  6. Nested procedures/functions are basically legacy from the times of Turbo Pascal, before we could write properly object-oriented code. They are still useful for procedural code, but if you organize your program's tasks into classes then you can replace nested procedures with private methods of the class and either pass needed values as parameters or move the local variables used as private fields to the class declaration. IMO that gives a much cleaner and easier to understand design, and it keeps down the size of the methods.
  7. I use them sometimes as a convenient way not to pass too many parameters. As far as I remember this comes with a performance penalty though. I declare those shared variables at the top of the main procedure, above the nested procedures, and those that are not shared below the nested procedures.
  8. Uwe Raabe

    VCL Form Designer Zoom

    Scaling forms is always problematic. We can see this every day with applications (not only Delphi ones) when used in a mixed DPI environment. Although I don't actually suggest to use it, there is an option to switch the form designer using a special PPI. The drawback is that it is used for all forms and not only for the large ones. Naively thinking that scaling the form display could easily be done by drawing onto a bitmap and simply display that downscaled, but that would imply that the whole user interaction has to be made with a bitmap instead of real controls. The effort to implement that with all its edge cases is way more than one would expect.
×