Jump to content

Roger Cigol

Members
  • Content Count

    306
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Roger Cigol


  1. In 11.1  a new VCL project defaults to clang32 (not classic).

     

    and I, for one, am an enthusiastic professional C++ programmer who uses Embarcadero RAD Studio 11.1.

     

    It is true there is a "balance" between the classic compiler and clang compiler for Win32 VCL applications. Once you have used C++ 17 it is very painful to go back to the restrictions of the classic compiler though.....


  2. I enjoy being an MVP and benefit greatly from conversing with esteemed colleagues, many of whom are much more experienced and widely knowledgeable than me.

    I keep a track of all the time I spend on MVP related tasks. At my standard programming hourly rate I spend significantly more time on MVP work than the cost of the

    annual subscription for "RAD Studio Enterprise". So yes, @Uwe Raabeis correct it does come with "some obligations".

    • Like 2

  3. This "generalisation" of FireDAC to suit the very many supported databases is one of it's great features. It is worth using approaches that continue/extend this generalisation primarily because it allows re-use of your code in other applications (that could be using different databases). As it happens the job that led to my question is actually migrating a working-well-for-many-years system that uses MS Access to a 64 bit application using PostgreSQL. The fact that the MS Access system uses FireDAC makes this task so much more straightforward.


  4. I have several tables that I want to completely empty. My plan was to use a single TFDQuery and to set (at design time) the SQL to       DELETE FROM :tablename       and then to set the :tablename parameter to type ptInput and datatype to ftString. Then I planned to call this query for each table, having set the parameter to the table name. But it doesn't work, each call to Execute() (following the setting of the parameter to the required table name) gives an exception.  I am using a 64bit PostgreSQL database so I can't test the parameter query at design time (can't connect from a 32 bit app). If I query my database directly using a query tool I can enter DELETE FROM MyTable and all the contents of MyTable disappear as required. I also find that the following code works (I am using C++ clang 64 in Alexandria 11.0):

     

          auto SQL(std::make_unique<TStringList>());
          SQL->Clear();
          SQL->Add(String("DELETE FROM ") + DestinationTableName);
          DestinationDeleteAllFDQuery->Close();
          DestinationDeleteAllFDQuery->SQL->Text = SQL->Text;
          DestinationDeleteAllFDQuery->OpenOrExecute();
     

    My question is : Is this expected behaviour? ie Is it known that parameters in FireDAC queries can not used to pass table names ?


  5. What you are really asking is "how to convert data in a string of a particular format" into a binary integer. But you are asking this question without giving us the actual string. So with the code where you "get the correct string" - what string do you get? maybe offer a few examples with different inputs on the ADC.


  6. Hi @David Heffernan, My pondering continued (and continues). Can you confirm that I am correct in concluding that it is the application (ie task) responsibility to maintain the correct FPU exception settings amongst threads it uses but it is the operating system's responsibility to maintain the FPU settings when process time is switched from one task to another. If this is the case then this makes sense to me and explains why applying the fixes so well outlined in your pdf would make a lot of sense.


  7. On 1/6/2022 at 4:47 PM, David Heffernan said:

    Of course, the floating point support for changing floating point control state is not thread safe in the Delphi RTL as I have been saying for more than a decade now.

    I am very worried by David H's posting here. But also this could explain an issue I've had on a system for a long time that calls a 3rd party dll that I suspect creates it's own threads. This seems to at random times generate unexpected windows "exception" messages.

    The documentation at https://docwiki.embarcadero.com/RADStudio/Alexandria/en/About_Floating-Point_Arithmetic is pretty good at telling you HOW to change floating point exceptions but not at all clear at what to set them to!

    Do you recommend when calling external 3rd party dlls that you make a call to SetExceptions() with a value of zero, storing the result (the current settings) into some local variable) before calling the 3rd party dll and then a call to SetExceptions passing the value saved in the local value as soon as the dll completes ?

    You may well choose to answer as an experienced Delphi programmer - any advice for me writting in C++ (using classic,, clang32 and clang64 compilers for different apps) would be welcome too.

    Thinking about the mulit-threading floating point interaction, surely the only way to achieve this would be to make sure the floating point unit is correctly configured before every floating point operation - a major overhead. I am still pondering this....

    
     

  8. I can't help here. But I can offer a warning to inexperienced "week number" users (which you may NOT be, I realise) and that is to beware of the week number 53 that does occur from time to time. I spent a long time debugging someone elses code once that stored week data in an array size [52] and overflowed causing corruption when week 53 came along.


  9. When I open any particular forum item it always opens on the first page. I guess this is a good idea if it's the first time one is reading that set of postings. But surely it is more common that you are going back to see recent additions to and ongoing discussion ( I do this regularly ). It would be much more convenient if, when opening and individual forum item, it opened on the last page (and perhaps even showing the most recent (ie the last) entry ?)....

    • Thanks 1
×