Jump to content

Dave Novo

Members
  • Content Count

    131
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Dave Novo

  1. There is a nice Delphi specific design patterns book as well. https://www.amazon.com/dp/1789343240 For databases, I know interbase is supposed to be designed that it stores transactions as part of its structure, which makes it easier to roll back.
  2. Dave Novo

    TMethodImplementation and its uses

    Of course I read your post. But I am unclear what could not be handled using anonymous methods? i.e. while the code in procedure ImplCallback(UserData: Pointer; const Args: TArray<TValue>; out Result: TValue); has a very general method signature, in actuality every implementation has to know exactly how many args are going to come in the args array, and exactly what they are going to mean. So why can you not wrap the python code in an anonymous method and then pass the anon method to delphi. I am unclear of what the example of why you would need a method stub.
  3. Dave Novo

    TMethodImplementation and its uses

    Hello, While technically this seems cool, why is this particularly useful? I see that I can create an event handler without an explicit object that will implement the event handler method. Why would I need to do this? If I needed this, would I not simply design my class to accept anonymous methods? Or is this for a trick to allow classes not designed to handle anonymous methods to actually handle them?
  4. Dave Novo

    Saving records

    Hello, This is a very old school way of saving data. Probably from Pascal in 1980. You should not do it this way any longer. I would do something as follows (note, I am writing this without testing syntax) TCustomer= record CompanyName:String[255]; SpotsAllocated:Integer; LicensePlates:String[255]; Parked:string[255]; procedure SaveToStream(aStream:TStream); procedure LoadFromStream(aStream:TStream) end; TCustomerArr=array of TCustomer; TCustomerArrHelper=record helper for TCustomerArr procedure SaveToStream(aStream:TStream) procedure LoadFromSTream(aSTream:TStream) procedure SaveToFile(const aFileName:string); end; procedure TCustomer.SaveToSTream(aStream:TStream); var ver:integer; begin ver:=1; // always save a version number in case you change the record format in the future aStream.WriteBuffer(ver,sizeof(ver)); // call aStream.Write for other fields end; procedure TCustomer.LoadFromSTream(aStream:TStream); var ver:integer; begin aStream.ReadBuffer(ver,sizeof(ver)); if ver<>1 then raise Exception.Craete('Version mismatch'); aSTream.ReadBuffer();// one readbuffer to match the writes above end; procedure TCustomerArrHelper.SaveToStream(aStream:TSTream); var ver:integer; cust:TCustomer; begin ver:=1; aStream.WriteBuffer(ver,sizeof(ver)); myLen:=Length(self); sTream.WriteBuffer(myLen,sizeof(mylen)); // save the length, you will use the length when reading in to allocate the array size for cust in self do cust.SaveToSTream(aStream); end procedure TCustomerArrHelper.LoadFromStream(aStream:TSTream); var ver:integer; myLen:integer; cust:TCustomer; begin aStream.ReadBuffer(ver,sizeof(ver)); if ver<>1 then raise Exception.Craete('Version mismatch'); aSTream.ReadBuffer(myLen,sizeof(mylen)); SetLength(self,myLen) for cust in self do cust.LoadFromSTream(aStream); end procedure TCustomerArrHelper.SaveToFile(const aFileName:string); var f:TFileStream; begin f:=TFileStream.Create(aFileName,fmCreate); try someCustArr.SaveToSTream(f); finally f.free end end
  5. Dave Novo

    Insert picture in TRichEdit from code

    The TRichview forums are excellent. You should post your questions there. Firstly, I am sure that question is answered there if you search, and if not, Sergey (the main developer) will give you a detailed answer. i.e. https://www.trichview.com/forums/viewtopic.php?p=35009&amp;hilit=insert+picture#p35009
  6. Dave Novo

    Developer Express gave up on FMX

    Sad news I feel https://community.devexpress.com/blogs/ctodx/archive/2020/12/02/fmx-grid-future-plans.aspx For those of us hoping to port our VCL applications with minimal fuss one day. There are a few other FMX grids available, but at least on the VCL side, none of them are as good as Dev Express grids.
  7. Hello, I wonder if anyone has encountered this before. Delphi 11.1 (initial release) was running fine on the computer (Win10). We tried to install Patch 1 according to the instructions at https://blogs.embarcadero.com/rad-studio-11-1-alexandria-patch-1-available/ using the "manual mode". Basically we opened the patch ZIP file and manually copied the files within the zip over the previous Delphi 11.1 files that were there. We did it folder by folder just to be paranoid and ensure we were copying the correct thing. We then restarted Delphi, and the IDE seems to start up, but when we get past the little startup wizard we get Does anyone have any idea why Patch 1 would trigger this problem. There is nothing trying to be loaded from a network location. All files were replaced in the standard delphi installation folders.
  8. Dave Novo

    problem upgrading to Delphi 11.1 Patch 1

    We have a license server internally.
  9. Dave Novo

    problem upgrading to Delphi 11.1 Patch 1

    We are trying to create a template machine that all developers can use. We dont want to have to have a script that all developers have to do manually, i.e. run GetIT, do X, do Y. The base machine should be setup that we just create virtual machines, join them to the domain, and developers login and are up and running. In fact, we are setting up the entire machine via Ansible, so its completely automated, documented and under version control. This ridiculous patch issue is our last issue. I dont see why when they release a patch then EMB cannot rebuild an installer with the patch incorporated.
  10. Dave Novo

    Testing with python

    There is no way for Python to know about the objects/functions in your delphi program. You have to create some classes and register them with the Delphi4Python to expose them to the python side. These can be your real classes in your application (not advised IMHO), or "bridge" classes that just expose functions to python. Then, in your implementation of the bridge methods, you call methods/functions on the delphi side.
  11. Dave Novo

    Pascal source code of Vidi Language, just published

    That has always been my dream, to have the spare time to create the "perfect" programming language! Good on you.
  12. Dave Novo

    Problems with installing RAD Studio 11 in Wine

    We deploy our compiled app for mac in Wine, via codeweavers, and it works great. It is a very sophisticated UI with many 3rd party components. However, I admit we have not tried to run the Delphi IDE in WINE.
  13. Dave Novo

    Problems with installing RAD Studio 11 in Wine

    The latest version of WINE is 7.0. You are using a very, very old version and trying to use the latest software with that. I would guess you are really shooting yourself in the foot trying to get it to work in a few year old version of WINE.
  14. When installing Delphi 10.4.2 or Delphi 11 it prompts me to install the Windows Software Development Kit. With lots of options (see below). What do I need that for? Are any of the things in the Development Kit necessary for Delphi to run properly? Or are these ancillary tools and/or libraries that are completely optional?
  15. Dave Novo

    Windows Software Development Kit - why?

    Thanks for all the help. Out of curiosity, aside from the SDK docs, which are easily available on the internet and we use all the time, are there any particular tools from the Windows SDK that you recommend? We use Innosetup for creating installers and it seems to have what we need. Although maybe it uses the MSIX from the SDK installed with Delphi behind the scenes, I have never checked that deeply.
  16. Dave Novo

    Windows Software Development Kit - why?

    This comes up as part of the install of both Delphi 10.4.2 and Delphi 11.
  17. Dave Novo

    PAServer for remote Debugging on Windows

    Even debugging 64 bit app on the same computer as the IDE is painful. I dont know why you think doing it on another computer would not be exponentially worse.
  18. Dave Novo

    LSP - Alexandria

    FWIW I asked if there was a secret registry code that could turn on the "classic compiler" but I did not hear back about it.
  19. Dave Novo

    LSP - Alexandria

    We do have too many semi-circular references. We are working on removing them slowly over time, which we thought would improve the compile time as well. But it seems not to improve the compile time very much and it takes tons of time.
  20. Dave Novo

    LSP - Alexandria

    This is as known problem on complex projects. We have the same things and sent the logs to EMB. Essentially, the LSP parser is taking too long to compile the code. Because it is taking so long, the LSP parser thinks there is a problem and restarts. This happens over and over again. I was not able to get the logs to EMB before Delphi 11 was in beta and David Millington said they could not fix it in time for Alexandria. We reported the problem in Delphi 10.4.2 but evidently according to David, and now your experience, it still persists in Delphi Alexandria. I was not able to get clarity exactly what about the code (if even there was anything particular) that was making the LSP take so long. You can look on the LSP progress bar and see the progress bar going forever basically. Sometimes it stopped for a brief time, then restarted.
  21. Make the storage data path (TDataStoragePath) a singleton object that initializes itself with the path. All other units that need the path will have to use the unit where TDataStoragePath is defined hence will force TDataStoragePath to initialize first.
  22. Hello Everyone, I am just wondering if below is simply a bug, or there is some method to the madness. One of the valid windows short date formats is the following So, one would think that if you change windows to the short date format above, and wrote the Delphi code fs:=TFormatSettings.Create; newDate:=StrToDate('05-Apr-17',fs) then you would get a valid date. However, you do not. I checked this on Win7 and Win10, with Delphi Sydney and Seattle. It is hard to believe something this ancient does not work. The fs record has the correct shortMonthNames loaded. There are a few strange issues. 1. The TFormatSettings.ShortDateFormat ends up being dd/MMM/yy because FixDateSeparator replaces the '-' with a '/'. I am not sure this is relevant though, as the TFormatSettings.DateSeparator is still '-' 2. The key thing that fails is TryStrToDate calls ScanDate which exits out because of if not (ScanNumber(S, Pos, N1, L1) and ScanChar(S, Pos, AFormatSettings.DateSeparator) and ScanNumber(S, Pos, N2, L2)) then Exit; i.e. it is trying to find a number, followed by a separator, followed by a number. Even though the current date format specifies that the month portion should be the short name format. Is there another date method I should be using that works more reliably. Or am I doing something wrong?
  23. Wow, I wish every time I complained about something then a resolution fell out of the sky in 3 days 😀
  24. Thanks for looking up the links. I guess if the bug report is >5 years old about this, I will not hold my breath.
  25. Sure, but then we have to either use a code hook or remember to never use StrToDate and use StrtoDateWrapper (or whatever we call it). It is surprising that these dates formats are not supported. They have been in windows for ages.
×