Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 09/25/21 in all areas

  1. Ian Branch

    wuppdi Welcome Page for Delphi 11 Alexandria?

    Daniel Wolf I miss my WUPPDI Welcome Page in D11. :-(
  2. I would like to add some candy to the code above. If you add three published fields to the form which names and types matches the ones in the clipboard text (which are predictable when created with the Rest Debugger), you can access the imported components by these fields: type TForm649 = class(TForm) Button1: TButton; Memo1: TMemo; procedure Button1Click(Sender: TObject); private public published RESTClient1: TRESTClient; RESTRequest1: TRESTRequest; RESTResponse1: TRESTResponse; end; procedure TForm649.Button1Click(Sender: TObject); var binary: TMemoryStream; cmp: TComponent; lst: TStringList; stream: TMemoryStream; begin { clear any existing instances } FreeAndNil(RESTClient1); FreeAndNil(RESTRequest1); FreeAndNil(RESTResponse1); lst := TStringList.Create; try lst.Add('object myName: TComponent'); // this resembles the instance given as parameter to ReadComponent lst.AddStrings(cArr); lst.Add('end'); stream := TMemoryStream.Create; try lst.SaveToStream(stream); stream.Position := 0; binary := TMemoryStream.Create; try ObjectTextToBinary(stream, binary); binary.Position := 0; binary.ReadComponent(Self); // Self puts the code into the form itself, but any other component will do finally binary.Free; end; finally stream.Free; end; finally lst.Free; end; Memo1.Lines.Add(RESTRequest1.Params[1].Value); end; You can even omit the RegisterClasses call then. The FreeAndNil of the three fields guarantees fresh components being created. It is as well possible to keep existing instances, but that can end up having properties with non default values when these are not included in the stream. (That may even be desired in some cases.)
  3. Does anyone have an updated version of wuppdi Welcome Page for Delphi 11 Alexandria?
  4. 0x8000FFFF

    Why empty dynamic arrays = NIL?

    I'm quite happy that I don't need any string.IsNullOrEmpty all over the place in my Delphi code as opposed to C#.
  5. Dalija Prasnikar

    Why empty dynamic arrays = NIL?

    If you need that distinction you can always wrap it up in nullable type. Delphi implementation of strings and dynamic arrays is fine as it is. Adding that distinction into array or string itself would only complicate working with strings and arrays with no benefits in most of the code. What would be default value of the array or string? nil or empty? If it is nil, welcome to nil nightmare, if it is empty, you need nullable again, or you would just want the ability to nil after it is initialized to empty. This is the fastest road to hell.
  6. This minor update introduces support for Delphi 11 and fixes some UI issues. To download it, please visit: https://devjetsoftware.com/downloads/
  7. Wich idiot (NOFI) wrote the getit manager? Feels like it's done by some intern? Slow search, Slow scroll, can not queue packages to install at once and go drink coffee. (sorry bad day 🙂 )
×