Jump to content


Popular Content

Showing content with the highest reputation on 06/15/22 in all areas

  1. Angus Robertson

    ICS V8.69 announced

    Sorry for the delay, ICS V8.69 is now available for automated install from GetIt for Delphi 10.4 and 11. Once installed, you should find the SSL demo sample group in a directory similar to: C:\Users\angus\Documents\Embarcadero\Studio\22.0\CatalogRepository\ICS_FMX-8.69-11\Samples\Delphi\SslInternet\SslDemos.bpg Angus
  2. We are a company located near Stuttgart, Germany and develop innovative machines for measuring and quality control. We are looking for Delphi developers for further development and maintenance of our software solution. The field of work will be to develop the UI as well as the processing of sensor data from cameras or laser scanners. Other tasks are the development of UIs for new machines or the definition and implementation of interfaces to other software. We offer a permanent contract in an open and valuing working environment. If you are interested, please contact me via PM and I will send our contact information.
  3. Pat Heuvel


    select * from mytable where tname = 'AA' and invno is null or datediff(day, current_date, tdate) >= 10
  4. Stano


    Serge_G - I have a question for you. Perhaps the founder of the topic forgives me. What is the advantage of your solution over subquery? I see a lot of unnecessary code I usually use subquery and I'm happy with it. Also because I don't know other techniques
  5. dummzeuch

    Waiting for something without blocking the UI

    The problem here is, that in Delphi "blocking" means that the UI freezes, unless he calls Application.ProcessMessages, which has its own drawbacks (e.g. other events can be fired, some of which may not be desired).
  6. FPiette

    Waiting for something without blocking the UI

    You could use a non-blocking asynchronous TCP component such as ICS (TWSocket and other for high level protocols). With ICS, methods like Connect, Send, Receive and other are not blocking, they are merely a request which are almost instantaneous. Later when connection is established, data received or sent, you have an event. The UI is never blocked, even with hundreds of active connections. No need to use thread of wait loop (Of course you may use both if you like complexity). You can install ICS from the IDE using GetIT, or download a zip file, or use the SVN repository. Have a look at http://wiki.overbyte.eu/wiki/index.php/ICS_Download. Dephi-Praxis has an ICS dedicated support forum : https://en.delphipraxis.net/forum/37-ics-internet-component-suite/
  7. Remy Lebeau

    Waiting for something without blocking the UI

    It seems like you are receiving the server's response asynchronously. In which case, I would suggest not waiting for the response at all. Send the request, and then move on. Let the asynchronous handler notify your code whenever the response actually arrives. You can always disable the UI in the meantime, if needed. Otherwise, if you must make the function act synchronously, even though the response is asynchronous, then at least consider waiting on a TEvent instead of a boolean, eg: function GetTCPIPC(const msg: string): string; begin if not clientclass.Connected then begin Result := ''; Exit; end; clientclass.MsgEvent.Reset; idTCPClient.IOHandler.WriteLn(msg); while clientclass.MsgEvent.WaitFor(10) <> wrSignaled do Application.ProcessMessages; Result := clientclass.msgfromserver; end; Otherwise, consider changing the function to read the response directly in the function itself, not asynchronously from elsewhere. That way, you can place a TIdAntiFreeze component on your Form to keep the UI responsive while the TCP socket is blocking the UI thread, eg: function GetTCPIPC(const msg: string): string; begin if not clientclass.Connected then begin Result := ''; Exit; end; IdTCPClient.IOHandler.WriteLn(msg); //read response here Result := msgfromserver; end; Though, you really should not be doing socket I/O in the UI thread at all. Consider a threaded approach, similar to what ioan showed earlier.