Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 03/28/23 in all areas

  1. Anders Melander

    Dealing with multiple component versions using the same ide

    Here you go: https://bitbucket.org/anders_melander/delphilauncher/src/main/ The following was copy/pasted from the repo readme.md so the formatting is a bit messed up: 1) Create a folder to hold the environment. > DelphiLauncher\MyProject We call this the environment root folder. 2) Create a folder named Packages under the environment root folder. > DelphiLauncher\MyProject\Packages We call this the package folder. 3) Export the content of the HKEY_CURRENT_USER\Software\Embarcadero\BDS\<version>\Known Packages registry key to a reg file named packages.reg in the environment root folder. <version> denotes the version of Delphi. For example 20.0 for Delphi 10.3 4) Rename packages.reg to packages.txt > DelphiLauncher\MyProject\packages.txt 5) Edit packages.txt Remove the first 3 lines of the file so the file only contains the package list. 6) For all the design-time packages in the list and all the run-time packages they depend on, copy the files to sub-folders 1 of the package folder. > DelphiLauncher\MyProject\Packages\Graphics32\GR32_DD110.bpl > DelphiLauncher\MyProject\Packages\Graphics32\GR32_RD110.bpl > DelphiLauncher\MyProject\Packages\DevExpress\dcldxRibbonRS28.bpl etc 7) Zip the content of the package folder into a file named packages.zip in the environment root folder. > DelphiLauncher\MyProject\packages.zip The package folder can now be deleted. The folder and its content will be recreated by the script on demand. 😎 Add the packages.txt file to packages.zip. The packages.txt file can now be deleted. The file will be recreated by the script on demand. 9) Create a text file named environment.ini in the environment root folder. > DelphiLauncher\MyProject\environment.ini The file is an ini-file with the following content: [environment] delphi=<version> project=<name> revision=<value> where <version> is the version of Delphi used. It must match the value of <version> mentioned in step 3. > delphi=20.0 <name> is the name of the environment. > project=My project The value is displayed in the Delphi title bar. <value> is the environment revision number/id. > revision=1 The combination of <name><value> is used to detect if the environment has been updated and should be refreshed. If you change, add, or remove any package files, one or both of <name> and <value> must be changed. Typically only <value> is changed. 10) Copy the start.ps1 script from another environment into the environment root folder. > DelphiLauncher\MyProject\start.ps1 Note: Packages that are listed in packages.txt but do not exist on disk are ignored. Packages located in $(BDSBIN) are assumed to be Delphi's own and are left as-is. The paths in packages.txt are ignored. Only the file names are significant. It's a good idea to place a text file named versions.txt in the environment root folder that contains the name and version numbers of the libraries contained in the package sub-folders. This makes it easier to determine what an environment contains. > DevExpress 2022.1.3.0 > TeeChart 9.0.26.0 > madExcept 5.1.2 (madCollection 2.8.11.7) If the project will be used with several different versions of Delphi, just create an environment root folder for each version. > DelphiLauncher\MyProject\Delphi 10.3 DelphiLauncher\MyProject\Delphi 11.0 Revision control The following files define an environment and can be placed under revision control (e.g. checked into a Git repository): start.ps1 environment.ini packages.zip versions.txt (optional) All other files are transitory and can be ignored. For Git it might be a good idea to enable LFS for zip files on the repository if the file is large. YMMV. The names of the sub-folders are not important. The sub-folders are only used to better organize the files. ↩
  2. Dave Novo

    Anyone know why?

    I agree with Darian. We have hired many good Devs in the past with and without Delphi experience. Of course the good Devs with no Delphi experience are already good Devs by any definition i.e. smart, know OOP well, diligent workers. But lets face it, the RTL/VCL is 10s or maybe 100s of thousands of lines of code. You cannot expect a Delphi noob to not take a while to learn even what classes are available and what the methods are. Never mind all the Delphi-isms how to most effectively use them. Never mind how to work around all the bugs in the IDE and all the tricks of the Delphi debugger. Never mind the subtleties of Delphi reference counting that can be different from other libraries. etc. etc. IME it takes at least a few years before a good developer becomes a true good Delphi Developer.
  3. Vincent Parrett

    Anyone know why?

    My experience over the last 20 years is that many new devs just do not want to learn delphi. I lost count of how many times people I was interviewing had either never heard of Delphi, or were surprised to hear it was still arround. People want to learn languages which they see a future in, which are modern and supports modern development targets. These days that is the web or mobile.
  4. Anders Melander

    Interface Reference counting

    Yes. Then there are no references to the object and it will be destroyed right before CreateAndReturnAnObject returns. IMO it would be better if you declare CreateAndReturnAnObject a function that returns an interface. MyObject is not an object; It's a reference (i.e. a pointer) to an object. First of all, it's important to know that a reference-counted object is destroyed when the reference count is decreased to 0. Now, when the object has been created it has a reference count of 0. When you assign the object to a variable (e.g. Result or "var MyObject") you create a reference and the ref count is increased to 1. The MyObject value returned from CreateAndReturnAnObject maintains the reference so the ref count isn't decremented. Only when MyObject goes out of scope, at the final "end;" will MyObject be nilled which decrements the ref count so it reached 0 and the object is destroyed. If your object is based on TInterfacedObject then I suggest you place breakpoints in all of the methods of TInterfacedObject and watch what goes on. For instance, it's good to know why the object starts with a ref count of -1 and how Delphi makes that work out in the end. There are some strange corner cases but basic reference counting in Delphi really is very simple and logical once you understand the rules.
  5. programmerdelphi2k

    Dealing with multiple component versions using the same ide

    in fact, using "R" param, nothing (files) it's really duplicated or similar... just a new key will be created on Registry to new session. this create a "RAD" session with only "default" references... that way, you can install your components using: if you want create your binary (DCU, BPL, DCP, etc...) ---> do it as expected, open DPK build and install! you can define "where" (folder) you desire use creating a "DPROJ" for each IDE (same that the "same") as Delphi do it! so, each "DPK" can have itself setup! (as it was a other-IDE) you see? if you have a installer (for example, DevExpress install), then, you can use just "Component -> Install Component" and indicated where is the BPL/DCP/DCU/PAS files, not needs re-Build again! You see? Do it that way, YOU DONT need re-Duplicate files for each IDE-session! at end, you'll have "many IDE-sessions" and using the same binary files, or, at last case, (when have distincts IDEs) each components in itself folders, as default when we have many IDEs using same component suites! nothing different.... if dont needs anymore the "new session IDE", just delete it from Registry! (and any other residual files used in your "components installations" -- if you do it)
  6. Anders Melander

    Anyone know why?

    This is my experience too. and unfortunately this too. Luckily we have both Delphi and C# projects and many works on both.
  7. Anders Melander

    Anyone know why?

    Yes, now they all work from home... at other companies.
  8. Remy Lebeau

    Interface Reference counting

    It depends. You did not show the actual declaration and implementation of CreateAndReturnAnObject(), so it is possible that it could go either way. For instance, if the parameter is an untyped var, then the created object WILL NOT have its reference count incremented when assigned to the parameter, and so the object will die (or worse, be leaked) when CreateAndReturnAnObject() exits: function TSomeclass.CreateAndReturnAnObject(var MyObject): Boolean; begin MyObject := TMyInterface.Create; // <-- refcount IS NOT incremented! Result := True; end; To solve that, you would need to use an explicit type-cast: function TSomeclass.CreateAndReturnAnObject(var MyObject): Boolean; begin IMyInterface(MyObject) := TMyInterface.Create; // <-- refcount IS incremented! Result := True; end; // Or: function TSomeclass.CreateAndReturnAnObject(var MyObject): Boolean; begin MyObject := TMyInterface.Create as IMyInterface; // <-- refcount IS incremented! Result := True; end; Or, call _AddRef() directly: function TSomeclass.CreateAndReturnAnObject(var MyObject): Boolean; var Intf: IMyInterface; begin Intf := TMyInterface.Create; // <-- refcount IS incremented here MyObject := Intf; Intf._AddRef; // <-- refcount is incremented again Result := True; end; // <-- refcount is decremented here On the other hand, if the parameter is typed as a var reference to IMyInterface, then the reference count WILL be incremented as expected: function TSomeclass.CreateAndReturnAnObject(var MyObject: IMyInterface): Boolean; begin MyObject := TMyInterface.Create; // <-- refcount IS incremented! Result := True; end; The calling code you have shown would compile in both cases (once you drop the var at the call site, see below), so it is important to know what the parameter is actually typed as to begin with. Specifying var when passing a variable to a function parameter is not valid syntax to begin with. You can use var only when declaring a variable/parameter, but not when passing it around. Pascal is not C#, or other languages, that require you to be explicit about how a variable is passed to a function parameter. It WILL be auto-incremented when it is assigned to a variable/parameter of a valid interface type.
  9. Anders Melander

    Choosing a Mac

  10. David Schwartz

    Dealing with multiple component versions using the same ide

    The problem with this is there are both files on the disk as well as entries in the Registry that need to be changed -- AND kept in sync! MAYBE you could get by just by changing Registry entries if you were really crafty. The safest thing might be to create separate user logins for each Dephi configuration and install on a per-user basis. But that will eat up a HUGE amount of disk space before long. I've seen places I've worked solve it by having virtual machines they'd RDP into that were configured differently, but only one person could be using one machine at any given time.
  11. David Champion

    Choosing a Mac

    The level entry M2 Mac Mini is excellent value for money but do some research on the speed of the SSD drive, The 256GB model uses a single NAND chip resulting in 50% slower performance compared to the 512GB model. To run headless you are likely to need an HDMI dummy plug. The headless ghost display emulator is available on Amazon.
  12. Darian Miller

    Anyone know why?

    Perhaps at some level, but there are practical realities. For example - are there just electricians - or some that work industrial, light commerical, some residential? You could be a residential electrician and likely work for a commercial outfit, but have to go through additional training. But perhaps the company doesn't want to train, or more likely, aren't experts at training. While they could hire an electrician that just worked on a few residential projects, there's definitely more business risk involved than hiring a licensed, experienced electrican that has worked on large industrial projects in the past. We've likely all learned one language and picked up others. But, you can certainly be an expert in one and a noob in another. For myslef, I've played with Python and can't stand it... I don't know if I could ever be productive in it. But it takes a long while to learn all the native libraries and nuances with any given platform. (New users to Visual Studio see a learning curve that wasn't nearly a decade ago.) So yes, you could treat all developers the same - but they aren't the same, not really. If you are in a pinch, a C , C++, C# developer could fit into a Delphi slot but someone that has just done Ruby on Rails would probably have a pretty hard time of it.
  13. programmerdelphi2k

    Dealing with multiple component versions using the same ide

    I dont know if I understood... but the RAD allow that run a session with a new name (like MSWin login user), then you would can install your components in each "session"... Each session it's just a new key Embarcadero on registry tree... look at HCU...Embarcadero see on help how to use -R param on BDS.EXE command ...\bds.exe -r MyNewSesstionName
  14. Roknjohn

    Delphi 11, migrate or wait

    I have been a Delphi user since it was first introduced. And before that I used Turbo Pascal. I have upgraded over a dozen times and currently on 10.4. I have a subscription that is still active but I have yet to upgrade to 11. I have dozens of very large active projects, and I dread any changes to my development environment including third-party components. Turbo Pascal and Delphi were much more advanced than any other IDE‘s on the market. Unfortunately, others have caught up and surpassed them. Embarcadero could learn a few things from the likes of webstorm. I started using Web storm for my JavaScript development and I am in love with its features and code writing efficiency, although it is a memory hog. I keep hoping for the new release of Delphi that is going to blow me away in terms of performance, stability, and code writing features. Expanding the VCLO, and all of the flavor of the day frameworks, don’t impress me. Just let me write my code, give old guy quick access to things that he can’t easily remember, while not being a great typer. And hurry, before ChatGPT takes it over.
×