Jump to content

DelphiUdIT

Members
  • Content Count

    773
  • Joined

  • Last visited

  • Days Won

    17

Posts posted by DelphiUdIT


  1. @dmitrybv

    The concept you express, that of simplifying the organization of the code in some way, has been discussed several times (so much so that now we can build the view of the "link" tree).

    However, the current organization, in my humble opinion, allows us to maintain a well-separated and at the same time compact organization of the code.
    The concept of "breaking" the code into unitary elements fits perfectly with the concept of units. It also fits with the concepts of scope (private / strict private / ...) and how they are now applied.

    The problem of "blocking" circular references is actually a problem that concerns the implementation of the code not carried out with rigor.
    Out of haste or inexperience, everything is put into a few units and then ... "you can't unring the bell".
     

    The concept of packages is already present (see third-party distributions or even bundles like Indy or FireDAC) but the use is still tied to units, and so you can "load" only what is necessary without having to compile the entire package, ensuring a fast and compact generation (... compact ... 🙂maybe it could be improved) of the executable code. For the runtime the concept of packages is already present similarly to other "languages".

    Of course, it is necessary to know what to reference as a unit but it is a hurdle that is easily overcome with time ... and it also helps to understand how the package was conceived and organized (which never hurts).


  2. 55 minutes ago, dummzeuch said:

    Did you ever try that? The biggest hurdle in updating any packages for a new Delphi version was moving from 2007 to 2009, where string changed from AnsiString to Unicode. But even that was easier than I expected for most components suites. With most packages you need to update some central include file and create new package projects. The source code will compile fine most of the time. Usually that takes at maximum an hour (but I have had cases where the Update took me several days due to some problems I introduced myself).

     

    But this will only work if you bought the source code, which I have always recommended because you never know when some 3rd party vendor might go out of business. And you  won't get the latest features of course.

    He requested a specific version, and I was not aware that it was still possible to obtain it. The fact that there are or not the source packages is irrelevant, he would not have made the request by listing them if he had them.
    ALL my projects are updated to the latest distribution version (maybe not in zero time), rarely some that are archived and remain there as historical memory.
    The fact that there is great backwards compatibility is a quality that has always been one of the main reasons linking with Delphi.
    However, even if the biggest obstacle was the advent of unicode as a standard, there are many other reasons (and a lot of)  that push me to think that a project (or maybe more than one) with all those third-party packages is not so simply portable to the new version. But I have no information on this, so I can only assume (maybe I'm wrong).


  3. 5 hours ago, Brian Evans said:

    When you buy the latest version of Delphi, you also get access to earlier versions of Delphi at no extra charge.: https://www.embarcadero.com/products/delphi/previous-versions Delphi 2010 is covered by this.

     

    A lot of third party component vendors do something similar for the same reason with older versions available in the registered users download areas. You may need to make a request or they might be there already.

    I didn't know previous access was that far back, I thought it stopped at the XE version.


  4. You can use the last edition released (Rad Studio 12.3 Athens)

    But the packages are not free, and the code will have to be changed.
    A 16 year leap (especially external packages) will be laborious and not cheaper.

     

    I think that is better to talk with Embarcadero rappresentative and explain the situation, they can redirect you to a professional developer.

    Of course some member of this community can help you, but I think they can contact you in private.

     

    You will provide them more information about the application and your knowledge.

     

     


  5. 27 minutes ago, Uwe Raabe said:

    Because it is the reverse of what Notepad in Windows 11 did to the files.

    Really? My notepad does not and has never done such an operation on its own, until I force it

    It reads a file with an encoding and saves it with the same encoding. And the only real usable option is to convert a file in ANSI to Unicode (UTF-xx) and not the "other way around".
    Converting a data that can have thousands (at least) of combinations into a data that can only have 256 makes no sense.
    In these cases you only work with ANSI encoding without any conversion (as in the case of iterations with old industrial systems or very old equipment).
    Taking into account that those who use Delphi normally develop for a multitude of "clients" (I mean develop applications that can be used in various environments) thinking of doing something similar is really a risk.


  6. 1 hour ago, jesu said:

    Yes, Windows 11 Notepad screws files. This never happened in Windows 10 after many years using it. You open a file double-clicking it, edit it and just click save expecting that it respects your encoding. Sometimes it does, sometimes not. Sure, you can use Save as to be sure that it uses the encoding you want, but that was never neccessary before.

    Just to be clear, I'm not talking about Delphi files. 

     

    The fact is that we need to restore these files without loosing time doing it by hand. I've used the table in this page to type the characters in my procedure:

    https://www.utf8-chartable.de/

    where I see that 

     

    Should I encode ka_AcentosMal in some other way? 

    I don't know why that page present those data. but in many "converters" and also looking at Unicode BMP, surrogate and extended this combination is not valid.

    This is  the right coding (with chinese char for test, all confirmed with UTF online services):

     

    image.thumb.png.f72116ab43a24dd60dd0a186677eeff8.png


  7. 1 hour ago, Uwe Raabe said:

    Load the file with UTF-8 encoding and save it with ANSI encoding. 

    Why someone would do this ? Depends on places where you do it (I mean OS, LANGUAGE, ....) you will have differents results.


  8. 43 minutes ago, Paul H said:

    Thanks David - I was hoping to find something with H-M-S support including setting / getting in decimals the way you can with TTime. It is probably no more than a couple of hours work to do something basic with a record helper, I just didn't want to duplicate something that already exists.

    Like I wrote, there is also Elapsed, that is based on TTimeSpawn: https://docwiki.embarcadero.com/Libraries/Sydney/en/System.TimeSpan.TTimeSpan

     

    You can use that advanced record ...


  9. (P.S.: I refer to Windows OS).

     

    First of all, take care that what you write in Delphi IDE may be in Ansi or UTF and depend on this your characters my be misunderstanding after read from files (in the laste release of Delphi those things work better).

     

    Second, string type in Delphi is equivalent to Unicode string (UTF-16). Normally the compiler does all the conversions needed, but in same cases it cannot.

     

    Look this for you convenience: https://docwiki.embarcadero.com/RADStudio/Athens/en/String_Types_(Delphi)

     

    Look better at you characters encoding: c3 8d may not be the exact character did you exepect:

     

    368833445_Screenshot2025-06-09112225.thumb.png.3c1c4e5a97d07d3cd6eedc82977ca299.png

     


  10. 37 minutes ago, Paul H said:

    I need a millisecond counter (NOT a timer) that can operate on Hours/Minutes/Seconds with an upper limit of > 1000 hr. Delphi's TTime and TTimeStamp aren't what I need - does anyone know of anyhing suitable? Without too much effort I could probably put something together using a record helper with a simple Cardinal type, but if something already exists I don't want to reinvent the wheel.

    You can use from unit System.DIagnostics the TStopWatch "record":

     

    Uses System.Diagnostics;
    
    var a:TStopWatch;
    
    begin
    	a := TStopWatch.StartNew;
    	....
    	....
    	a.Stop;
    	ShowMessage(a.ElapsedMilliseconds.toString);
    end;

    For better infohttps://docwiki.embarcadero.com/Libraries/Athens/en/System.Diagnostics.TStopwatch

    P.S.: you have also the "Elapsed" property that maintain the features you required (but you can simple calculate them from "milliseconds".

     


  11. 1 hour ago, Rollo62 said:

    Only if you want to produce small scripts while drinking coffee in a sunny place, then the cost of Apple mobility is perhaps worth the price tag IMHO. :classic_biggrin:

    OT:

    I normally do it during summer days on a beach :classic_biggrin: but with a Windows PC (and not for a small scripts) .... drinking beer and looking at the sea. :classic_biggrin:

    I can't wait for summer to finally arrive. :classic_smile:

     

    Sorry for the OT but reading the post made me feel nostalgic for summer.

    • Like 1

  12. 23 minutes ago, Anders Melander said:

    is like using Assigned on pointers (even object pointers). On delegates it makes sense, but for everything else I think (FooBar <> nil) is more readable and better communicate intention than Assigned(FooBar). I'm sure everybody agrees with me on that 😉

    Lool, I always use Assigned(...) hoping that one day or another it will solve all the situations (either nil or an invalid pointer) 🙂


  13. 52 minutes ago, Anders Melander said:

    What change? You mean a possible future change of the index type?

     

    I can't see how any of the Pred used here would survive that:

    
    TABLE_DATA: array[0..pred(TABLE_SIZE * 3)] of string
    Elements : array[0..pred(TABLE_SIZE)] of record

     

    The use of pred here is only the result of copy / paste operation. But I use pred sometimes, especially when there is a dimension of an array in play. In a for / to cycle instead I use normally "-1".

     

×