Jump to content

Lajos Juhász

Members
  • Content Count

    874
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by Lajos Juhász


  1. Just now, Fabian1648 said:

    When you have a software that is used in different countries, the date display format changes from one time to another (In France, you will have a "dd/mm/yyyy", in the USA a "mm-dd-yyy", etc.). If you use a custom format in the code, you will have to create a cutom format for each country!!!!!!!!!!

     

    If you change the regional settings in your application you will change it in all of the countries the same thing as far as I can see.


  2. https://stackoverflow.com/questions/849568/how-long-does-a-tdataset-bookmark-remain-valid
     

    Answer from Jeroen Wiert Pluimers:

     

    Like both c0rwin and skamradt already mention: the bookmark behaviour depends on the TDataSet descendant you use.

    In general, bookmarks become invalid during:

    1. close/open
    2. refresh (on datasets that support it)
    3. data changes (sometimes only deletions)

    I know 1. and 2. can invalidate your bookmarks in TClientDataSets. I am almost sure that for TClientDataSets it does not matter which underlying provider is used (TSQLQuery, TIBQuery, etc).

    The only way to make sure what works and what not is testing it. Which means you are totally right in not using them: bookmarks have an intrinsic chance of being unreliable.

    To be on the safe side, always call BookmarkValid before going to a bookmark.


  3. 1 hour ago, Stano said:

    Since I'm a layman, can you give a simple example here? To know what you mean.

    When you've a simply example than it's trivial to see a bug. Trouble is when you change old code in hurry (critical error for what a fix must be delivered instantly) and introduce another one. For example, when you have a TStringList with objects you can cast the string instead of the object. For example, in a longer code it can be difficult to spot (you read in hurry and looks ok, you know that the object is inside the list):

     

    TMyObject(fMyStringList[lItemIndex]).DoSomething

     

    instead of:

     

    TMyObject(fMyStringList.objects[lItemIndex]).DoSomething.

     

    while this will not compile:

     

    (fMyStringList[lItemIndex] as TMyObject).DoSomething.

     

    The same goes with the original example in this thread as operator instantly shows that the cast is not valid.

     

    Disclaimer. With generics you can reduce the required typecasts however I still have to work on some D2007 code and most of the code was writen using Delphi 5.

     


  4. 7 hours ago, Mike Torrettinni said:

    Thanks, I do have correct version as you pointed out, but this was a test if it works. casting with AS  fails, but this one worked and just wanted to try to figure out why. 

    As operator checks whenever your are doing a valid type conversion or not (if not exception is raised), while when writing TypeName() it will do the conversion without a check. Thus it's a valid in Delphi to write:

     

    TStringList(4).Add('Test')

     

    Now the compiler will pretend that the constant 4 is a TStringList and call the Add method on it. This is an easiest way in Delphi to have an Access Violation.

    (BTW. This is a reason why I started to use as instead of hard type cast recently.)


  5. When in the release notes they write full installation it means uninstall and reinstall. On webinars more than once was a question why they request the uninstall steps why not just replace the files. The answer is that it's easier to test and less change to have an error. (It makes sense but a bit more work when you have to install a "patch" of 6GB).


  6. Here it is: https://blogs.embarcadero.com/available-today-the-cbuilder-and-rad-studio-11-1-5-c-code-insight-update/

     

    The relevant part is:

    Being tightly focused on C++, the 11.1.5 C++ Code Insight Update has no benefit for Delphi customers and we do not recommend Delphi customers to install it. Other than the C++ Code Insight changes, 11.1.5 is identical in features to 11.1. RAD Studio 11.1.5 is a full installation, and includes all hotfixes issued for 11.1.


  7. 39 minutes ago, PeterBelow said:

    for i := Low(CompanyDataBase) to High(CompanyDataBase) do

    As far as I remember this should be

     

    i:=0;

    SetLength(CompanyDataBase, FileSize(f))

    while not eof(f) do

    begin

      Read(f, CompanyDataBase);

      inc(i);

    end;

     

    Last time I wrote a code like this was in Pascal. (Btw. to be on the safe side you should also define the record as packed).


  8. 1 hour ago, Andy1234 said:

    Perhaps I misunderstand, but it seems to me that Xcode is needed only for exporting SDK. He does not take any part in the assembly.
    I made this conclusion from the fact that the current assembly is going well for me.

    The app is sent to Apple for review, but only SDK 14 fails:

    ERROR ITMS-90725: "SDK Version Issue. This app was built with the iOS 14.0 SDK. All iOS apps submitted to the App Store must be built with the iOS 15 SDK or later, included in Xcode 13 or later." (-18000)

     

    As far as I understood XCode is needed to sign the application (I don't touch those things as I develop only for Windows and just read about other platforms in case I must do some work on them).


  9. In this code snippet you don't have how you set up the connection and that's the error you got.

     

    My guess is that in your code somewhere the connection's ConnectionDefName property is set to C:\Prog2\employee.fdb instead of EMPLOYEE.

     

     

×