Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Remy Lebeau

    DeleteFile Compilation Message

    Cross-platform support for non-Windows platforms. Mac OSX is certified POSIX-compliant. Linux, iOS, and Android (which runs on top of Linux) are mostly compliant, but not certified.
  3. David Heffernan

    Open Type Arrays?

    It's not double the work.
  4. Remy Lebeau

    Present status of Indy

    Still actively developed (by me). RAD Studio 10.4 includes an updated trunk version from Indy's GitHub repo from about 2 months ago. I'm not in charge of, or involved with, how Embarcadero incorporates help files for 3rd party components. But I do recall that Indy's help files are included, somewhere. Although, Indy's documentation is quite dated, it hasn't been updated in many years. There have been property/interface changes made over the years that still need to be documented.
  5. Today
  6. PeterPanettone

    Open Type Arrays?

    Why make double work? The employer would like it if you need only half the time.
  7. Did you install the hooks in a way that you don't override any existing hook that might be there already?
  8. Stefan Glienke

    Open Type Arrays?

    Variant will accept everything and their dog which is hardly what is wanted here. @PeterPanettone This is not in any form an array but as @david berneda rightly said a union. See https://en.wikipedia.org/wiki/Union_type We already have such things in Delphi: TVarRec, Variant, TValue. However none of them can be specified to only accept a certain amount of types. If you want something like that then write a custom record type with implicit operators and a TValue as internal storage (saves you from taking care of mixing unmanaged and managed types in a proper way) Just for the lulz: {$APPTYPE CONSOLE} uses SysUtils, Rtti; type Union = record fvalue: TValue; class operator Implicit(const value: string): Union; class operator Implicit(const value: Integer): Union; class operator Implicit(const value: Union): string; class operator Implicit(const value: Union): Integer; function IsType<T>: Boolean; end; procedure DoSomething(const AParam: Union); begin if AParam.IsType<string> then Writeln('string: ', string(AParam)) else if AParam.IsType<Integer> then Writeln('integer: ', IntToStr(AParam)); end; class operator Union.Implicit(const value: Integer): Union; begin Result.fvalue := value; end; class operator Union.Implicit(const value: string): Union; begin Result.fvalue := value; end; class operator Union.Implicit(const value: Union): string; begin Result := value.fvalue.AsString; end; class operator Union.Implicit(const value: Union): Integer; begin Result := value.fvalue.AsInteger; end; function Union.IsType<T>: Boolean; begin Result := fvalue.IsType<T>; end; begin DoSomething(42); DoSomething('Hello world'); end. If you want to go funky then make it a generic type with 2, 3, 4, ... generic type parameters 😉
  9. Uwe Raabe

    Open Type Arrays?

    And copy the method body in each? Well, it could split that code and put the pieces into the appropriate overload. On the other hand, that is exactly what a developer would do - and that is way more readable and maintainable (at least IMHO).
  10. David Heffernan

    Open Type Arrays?

    I would absolutely not want syntax like that. If that's the way you want to go you can do it today with generics. In an ideal world I'd like to see the generality offered by C++ templates though. That would allow algorithmic programming that is just too painful with generics.
  11. dummzeuch

    Open Type Arrays?

    Yes
  12. David Heffernan

    Open Type Arrays?

    You mean with the code from OP?
  13. sgcWebSockets is a complete package providing access to HTML5 WebSockets API (WebSocket is a web technology providing for bi-directional, full-duplex communications channels, over a single Transmission Control Protocol (TCP) socket) allowing to create WebSocket Servers, and WebSocket clients in VCL, Lazarus and Firemonkey Applications. What's new latest versions - New Telegram API Component for Windows, Android, OSX and Linux. - Improved MQTT client component: support for 3.1.1 and 5.0. - Improved Indy Server + IOCP. - Improved Binance and Kraken APIs, now support full WebSockets and REST Protocols. - Fixed some bugs using OpenSSL 1.1.1 and TLS 1.3 - Several improvements about performance and stability.  Main Features: - WebSocket and HTTP Support: sgcWebSockets includes client and server-side implementations of the WebSocket protocol (RFC 6455). HTTP/s is also full supported. Support for plain TCP is also included. - SSL/TLS for Security: Your messages are secure using our SSL/TLS implementation. Widest compatibility via support for modern TLS 1.3, TLS 1.2, TLS 1.1 and TLS 1.0 - Protocols and APIs: Several protocols are supported: MQTT (3.1.1 and 5.0), STOMP, WEBRTC, SIGNALR CORE, WAMP... Built-in protocols support Transactions, Datasets, QoS, big file transfers and more. APIs supported for third-parties like Pusher, Bitfinex, Huobi, CEX... - Cross-platform: Share your code using our WebSockets library for your Delphi VCL, Firemonkey, Intraweb, Javascript and C# projects. Includes Server, Clients and several protocols for building and connecting to WebSocket applications. - High Performance WebSocket Server based on Microsoft HTTP Framework and IOCP. Trial Version: https://www.esegece.com/websockets/download Compiled Demos: http://www.esegece.com/download/sgcWebSockets_bin.zip More Info: http://www.esegece.com/websockets
  14. I still have no clue what happens here, so I started another CrossPost in the German DP.
  15. dummzeuch

    DDetours v2.2

    Unfortunately neither a rebuild nor restarting the IDE worked in this case. Even a command line compile with DCC failed. I'm not that interested in Delphi 6 support, so I give up.
  16. Mahdi Safsafi

    DDetours v2.2

    Thanks 🙂 It happened several time for me under different IDE with different libraries, I just noticed that it happens often when code is using .inc files. I used to do a clean and rebuild and that worked in many time. Sometime I need to restart the IDE.
  17. Mahdi Safsafi

    Open Type Arrays?

    For dynamic language like typescript ... sure they're designed to work like that. Elsewhere (Delphi), this is going to be awful because you're checking the type at runtime, moreover you are mixing reference(string) with integer ... how are you expecting from the compiler to pass argument for your call (i.e 8 bytes and 4 bytes) ? Using union may solve the problem but still there is a drawback to check for the type. So I don't think it is a good idea at all.
  18. I my last GExperts related blog post I wrote about the new “Close Exception Notification” expert which I just had added to GExperts. It was a hack that hooked the Exception Notification dialog. This spawned a discussion in the international Delphi Praxis forum and resulted in a rewrite of the expert. It’s now called “Filter Exception” expert and instead of hooking the dialog it directly hooks into the code that shows this dialog. Thus it prevents the dialog from being shown for filtered exceptions. Read on in the blog post.
  19. Cristian Peța

    Open Type Arrays?

    For this case will work with Variant. procedure DoSomething(const AParam: Variant); begin ShowMessage(AParam); end;
  20. david berneda

    Open Type Arrays?

    Some languages offer union types to do this, for example in Typescript: https://www.typescriptlang.org/docs/handbook/advanced-types.html#union-types
  21. dummzeuch

    Open Type Arrays?

    Not necessarily. The compiler could generate a set of overloaded procedures for this.
  22. David Heffernan

    Open Type Arrays?

    This seems worse than method overloading to me. There you have compile time branching. Here you have to perform runtime type checking.
  23. PeterPanettone

    Open Type Arrays?

    Today in the shower I had an idea - wouldn't Open Type Arrays be a useful thing? What if we could write: procedure DoSomething(const AParam: [string, Integer]); begin if AParam is string then ShowMessage(AParam) else if AParam is Integer then ShowMessage(IntToStr(AParam)); end; One could argue that if we want flexibility we could use overloaded procedures. But if we have procedures with many different parameters then we had to write a lot of overloaded procedures - Open Type Arrays would simplify things a lot. What do you think?
  24. Hello, We're glad to announce the release of Resource Builder 4! Resource Builder 4 is the all-in-one solution that includes: Full support for Unicode in resources and RC files. Most precise and fastest RC compiler. Powerful editor for graphic resources and image files such as bitmaps, icons, cursors and other. You can create icons and cursors with any size (up to 1024x1024). Full set of resource editors for almost all resource types: dialogs, strings, menus, accelerators, animated icons and cursors and others. Support for really large resource data and resource files. .NET resources support. and more... Resource Builder web site: https://www.resource-builder.com/ You can download new version from: https://www.resource-builder.com/download-resource-builder/
  25. timfrost

    Present status of Indy

    I see Indy help in the IDE menu under Help / Third-Party Help
  26. How limit to one instance on android, windows, linux and mac ? There is any cross platform code? Thank you in advance. Pavel
  27. Stuart Clennett

    Handling MultipartFormData

    @alejandro The demo does not save the file at all. You are required to implement that. However it is quite simple. For example, in the `StoreDataAndFile` method in `Server.Resources.pas` you could use a memory stream to access the Bytes and save to a file if SameText(LParam.FieldName, 'image') and LParam.IsFile then begin Result.FileSize := Length(LParam.AsFile.Bytes); Result.FileName := LParam.AsFile.FileName; // This will save the file lStream := TMemoryStream.Create; try lStream.Write(LParam.AsFile.Bytes, Length(LParam.AsFile.Bytes)); lStream.SaveToFile(TPath.Combine(C_RootPath, TPath.GetFileName(LParam.AsFile.FileName))); finally lStream.free; end; end In this instance, `C_RootPath` is just a folder on the server where uploaded files should be saved, but you could make this dynamic based on user info in the Token for example. Hope this helps
  1. Load more activity
×