Jump to content

Ian Branch

Members
  • Content Count

    1272
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Ian Branch

  1. Hi Team, Win 11, D11, 4k monitor. Delphi is started as /highdpi:unaware. I know this is something I am going to have to deal with more and more. :-( I have a form that during design time is 1462 wide, ClientWidth of 1449. When I Compile or Build it the form collapses on screen to ClientWidth 1132. :-( BorderStyle is bsDialog. Scaled is OFF. The Manifest has DPI Awareness set to None. The Apps are to run on old Win 7 PCs. I can stop it collapsing by setting a MinWidth Constraint for the form but I shouldn't need to. Or do I? What am I missing in my form setup please? Or it is what it is? Regards & TIA, Ian
  2. Ian Branch

    How to change the tmainmenu Designer ?

    And we are better off for it. Thank you.
  3. Ian Branch

    wuppdi Welcome Page for Delphi 11 Alexandria?

    I was/am asking gkobler..
  4. Ian Branch

    wuppdi Welcome Page for Delphi 11 Alexandria?

    Hi, Will you be doing one for D12?? Regards, Ian
  5. Ian Branch

    Export a thread??

    Is there a way to export a thread/conversation. In a couple of cases there are conversations I would really like to sit back with a piece of paper, read & digest the content over a noce red wine rather than staring at a computer screen. 😉 Regards & TIA, Ian
  6. Ian Branch

    Addictive software??

    It would seem Addictive Software, the makers of the Addict spell checker, are no more. 😞 What does one do now for spell checking in Apps that run on Win 7? Ian
  7. Ian Branch

    Is it just me??

    Hi Team, Is it just me that can't log into the Quality Portal?? It keeps asking for my Username, even though it is there and is the same one I have used for years... Whuuuppp!!! Suddenly it works... Ian
  8. Hi Uwe, D11.3, latest MMX. If I have this code in my type declaration: {code} .... procedure FormShow(Sender: TObject); procedure IndexOrdChange(Sender: TObject); private const iWidth = 920; end; implementation '''' {code} The function changes it to this: {code} .... procedure FormShow(Sender: TObject); procedure IndexOrdChange(Sender: TObject); private const <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< const iWidth = 920; end; implementation '''' {code} Which of course causes an error. If I have this: {code} .... procedure FormShow(Sender: TObject); {$IFDEF MyTest} procedure IndexOrdChange(Sender: TObject); {$ENDIF} private const iWidth = 920; end; implementation '''' {code} It removes the $IFDEF/$ENDIF block totally. Regards, Ian
  9. Ian Branch

    Some REST help please.

    Hi Team, My Customer has asked me if I can add SMS sending to his Apps. In support he has sent me a document from Vodafone, he is a repairer for Vodafone, with the following information. I know absolutely nothing about REST and/or its usage in/with Delphi. Could I prevail on someone to create a small delphi unit that incorporates whatever is necessary to send an sms? It would be very much appreciated. Regards & TIA, Ian
  10. Any chance of providing the link? Or a copy of your working example? Regards & TIA, Ian
  11. Ian Branch

    Some REST help please.

    CRACKED IT!!!! As Patrick suggested, put the Json request into the Custom body. It didn't work for me the first time as I suspect I had the Json constructed wrong, and I still had Parameters in the RESTRequest. All sorted now. Now to actually create the App. 🙂 My thanks to all that contributed to my first foray into REST. Appreciated. Regards, Ian
  12. Ian Branch

    Some REST help please.

    This was the doc they supplied me. SMS Gateway API Specifications v2.0.pdf
  13. Ian Branch

    Some REST help please.

    Hi Patrick, You mean put this: "{"username": "email@mail.com", "secret":"password","shortcode":pacificbulksms","msisdn":"6798688008","message":"Hello James..."}" into the Custom body? With the correct values of course. 😉 I just tried that, same result. Ian
  14. Ian Branch

    Some REST help please.

    Hi Uwe, What should this parameter be? All the parameters basically look like this: Ian
  15. Ian Branch

    Some REST help please.

    Hi Uwe, It is set in the RESTRequest component. Ian
  16. Ian Branch

    Some REST help please.

    Correction! I thought it had been successful in the Debugger but I was looking in the wrong place. 😞 Still an Empty Request error. This is the Debugger Request Tab: This is the Parameters Tab, with key info changed: 😉 You will note the 'Response' says 200:OK..... But the Tabular Data Tab says it was an error. I spoke to the Phone owner and he hasn't received any messages. I'm confused. Ian
  17. Ian Branch

    Some REST help please.

    Hi Patrick, When I put the Parameters into the REST Debugger, it says it is successful. When I have the parameters in the RESTRequest and right-click|Run, it is successful. But, If I leave The Client and Request exactly the same and inthe Delphi App do RESTRequest1.Execute, it fails. 😞 procedure TForm12.btnComponentsClick(Sender: TObject); var obj, code, data: TJSONObject; sCode, url: string; begin // // Call the REST API and handle the response RESTRequest1.Execute; // ShowMessage('Status Code = ' + RESTResponse1.StatusCode.ToString); obj := RESTResponse1.JSONValue as TJSONObject; scode := obj.Values['code'].Value; data := obj.Values['data'] as TJSONObject; url := data.Values['text'].Value; ShowMessage('Code = ' + scode + sLineBreak + 'Text = ' + url); end; Returning 'Status Code = 200' for the first ShowMessage, and 'Code = 302 Text = Empty Request.....' for the second showmessage. 😞 Regards, Ian
  18. Ian Branch

    Some REST help please.

    So, I got test parameters from Vodafone. When I run the App I get a 'Empty Request...' message. Clearly I have missed setting something. 😞 Ian
  19. Ian Branch

    Some REST help please.

    Hi Team, I'm back. Thank you for your inputs. I have this so far: procedure TForm12.Button1Click(Sender: TObject); begin // // The RESTClient has already been configured. // RESTRequest1.AddParameter('username', 'email@email.com'); RESTRequest1.AddParameter('secret', 'password'); RESTRequest1.AddParameter('shortcode', 'pacificbulksms'); RESTRequest1.AddParameter('msisdn', '6799998122'); // I take it this is the destination mobile Phone #?? RESTRequest1.AddParameter('message', 'Hello World'); // Call the REST API and handle the response RESTRequest1.Execute; // Access the response content if RESTResponse1.StatusCode = 200 then begin // Process the response content (e.g., RESTResponse.Content) var sResponse := RESTResponse1.Content; Label1.Caption := sResponse; // // Example response {"result":"success","code":"200","data":{"text":"SMS sent successfully."}} var sResult := GetResponseParameters(sResponse, 3, 4); var sCode := GetResponseParameters(sResponse, 7, 8); var sMessage := GetResponseParameters(sResponse, 13, 14); end else begin // Handle error cases end; // end; The RESTClient has the BaseURL set as "https://pacificbulksms.com". The RESTRequest has the Resource set as "api/restJson". Are there any other default settings I need to change, or settings I need to make? Aside of course getting actual usable test parameters from Vodaphone. 😉 Regards & TIA, Ian
  20. Ian Branch

    What am I missing here??

    Hi Team, I am trying to assign the AfterEdit event to a TTable. I have this in the private area: procedure jtAfterEdit(Sender: TOBject); I have this in the DatamoduleCreate; JobTickets.AfterEdit := JTAfterEdit; And this as jtAfterEdit: procedure TdmC.JTAfterEdit(Sender: TOBject); begin // JobTickets.FieldByName('UserID').AsString := AUD.UserID; lNewRecord := False; // Specifically reset the flag. // end; Delphi tells me that "[dcc32 Error] dmCurrent.pas(861): E2010 Incompatible types: 'TDataSet' and 'TObject'" for this line: JobTickets.AfterEdit := JTAfterEdit; What have I missed pls? Regards & TIA, Ian
  21. Ian Branch

    What am I missing here??

    Tks Thomas. Changing "Sender: TObject" to "Dataset: TDataset" did the trick. Regards & Tks again, Ian
  22. Ian Branch

    Some REST help please.

    Hi Team, I haven't forgotten this, just dealing with some issues for a Customer.
  23. Ian Branch

    Credit Card Bank Fee and VAT/GST?

    Hi Team, In some places, not all, the use of a Credit Card to pay by a Customer incurs a 'Bank Fee' on the Seller. The Seller offsets this by adding an appropriate 'Bank Fee' to the sale. Question - Where VAT/GST applies, the Sale will incur a VAT/GST as part of the Sell Price. Does the 'Bank Fee' also incur the VAT/GST? What is the general experience/knowledge? Regards & TIA, Ian
  24. Ian Branch

    Feedback Request - FastReports vs ReportBuilder?

    In my early Delphi days I used FastReport however at that time it didn't/couldn't do what i needed so I moved to ReportBuilder. Since then I have never seen or come across a reason to look for another report engine. Ian
  25. Hi Team, I redid my routine to use StrCmpLogicalW. Now I get... uses System.Generics.Defaults; procedure SortStringArray(var AStringArray: TArray<string>); var Comparer: IComparer<string>; begin Comparer := TComparer<string>.Construct( function(const ALeft, ARight: string): Integer begin Result := StrCmpLogicalW(PChar(ALeft.ToLower), PChar(ARight.ToLower)); end ); // Sort the string array using the custom comparer TArray.Sort<string>(AStringArray, Comparer); end; Regards & Tks. Ian
×