Jump to content

Uwe Raabe

Members
  • Content Count

    2555
  • Joined

  • Last visited

  • Days Won

    149

Posts posted by Uwe Raabe


  1. 22 minutes ago, softtouch said:

    und when I allow to add them

    You probably didn't allow to add the units,  but allowed to add SynEditDR to the requires clause instead. If you deny that request, the units are compiled into your package.

     

    If you want to make use of the SynEdit package you must make sure that SynEditDR.dcp can be found during compile and deploy the corresponding bpl with your application.


  2. 4 minutes ago, DelphiUdIT said:

    What I think could instead be a problem is not so much the download of the correct installer of the product, but rather its activation which still has a limited number of actions.

    Even without an active subscription one can request a bump for the installation counter. It has just to be requested from sales instead of support.


  3. @Patrick PREMARTIN

    I have never seen some documentation about a REST API to forbit or even avoid POST requests. If you have a link to such docs I would be interested.

     

    In my (surely limited) experience with REST API implementations that are not simply read-only, I never encountered anything restricted to GET requests.


  4. IMHO the best way ist to use a dedicated class handling the parameters and place that in body:

    type
      TMyParam = class
      private
        FUserName: string;
        FSecret: string;
        FShortcode: string;
        FMsisdn: string;
        FMessage: string;
      public
        property Message: string read FMessage write FMessage;
        property Msisdn: string read FMsisdn write FMsisdn;
        property Secret: string read FSecret write FSecret;
        property Shortcode: string read FShortcode write FShortcode;
        property UserName: string read FUserName write FUserName;
      end;
    ...
      var myParam := TMyParam.Create;
      try
        myParam.UserName := 'email@email.com';
        myParam.Secret :='password';
        myParam.Shortcode := 'pacific bulkms';
        myParam.Msisdn := '6799998122';
        myParam.Message := 'Hello World';
        RestRequest1.AddBody(myParam);
      finally
        myParam.Free;
      end;

     

    • Like 2

  5. May be I missed it, but I cannot see where you set RESTRequest1..Method to rmPost (the default is rmGet). The default parameter kind is pkGetOrPost, which put the parameters in the URL for GET and into the body for POST. This would explain the "Empty Request..." error.


  6. The problem in your code is that the anonymous method calling RunWork uses the counter variable directly. While it is correct that this variable is captured for the anonymous method, it is captured by its address and not by its value. Therefore the RunWork call uses the value of counter that is given in the moment of that call. Usually that is different from what you expect.

     

    You can solve this by injecting a method returning the anonymous method with the counter value at that time.

    function MakeRunWork(ACounter: Integer): TProc;
    begin
      Result :=
        procedure
        begin
          RunWork(ACounter);
        end;
    end;
    
    procedure TForm780.Button1Click(Sender: TObject);
    const
      NumberOfParts = 1;
    var
      counter: integer;
      TaskArray: array of iTask;
    begin { --- run button --- }
      SetLength(TaskArray, NumberOfParts);
      for counter := 0 to NumberOfParts - 1 do
      begin
        try
          TaskArray[counter] := TTask.Run(MakeRunWork(counter));
        except
          on E:EAggregateException do
            ShowMessage( E.ToString);
        end; // try
      end; // for counter
    end;

     

    • Like 5
    • Thanks 1

  7. 5 hours ago, Willicious said:

    The code needs to execute iff all conditions are met (Y - 0 and Y - 1 and Y - 2 and Y - 3, etc) and not just if any of the possible 6 conditions are met (Y - 0 or Y - 1 or Y - 2 or Y - 3, etc).

     

    I don't understand how this can even work at all. If PosY equals Y - 1 then PosY cannot be equal to Y - 2 nor Y - 3 and so on. There can either one condition be met or none, but not all.

    • Like 1
×