Jump to content

Lajos Juhász

Members
  • Content Count

    986
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by Lajos Juhász

  1. Lajos Juhász

    Alfabetical order of a letter

    ord('C')-ord('A')+1, ORD('E')-ORD('A')+1, ...
  2. Lajos Juhász

    SQL expression evaluation not supported

    Most probably the problem is the group by part. You've there O.Delvdate that is not in the select list. Interbase 2017 Update 1 (http://docwiki.embarcadero.com/InterBase/2020/en/Enhancements_to_GROUP_BY_and_ORDER_BY) introduced the extended syntax. If you're using a version that support you can write: SELECT O.DELVTYPE, SUM(OD.REMAINQTY) QTY, (Case O.DELVTYPE When 'Sea' then O.DELVDATE + 45 else O.DELVDATE + 15 end) as DELVDATE FROM ORDETAIL OD JOIN ORDERS O ON O.RNO=OD.RNO WHERE OD.ITEMNO = 'ABX22' GROUP BY O.DELVTYPE, 3 HAVING SUM(OD.REMAINQTY) > 0
  3. Lajos Juhász

    Delphi compatibility with Windows 11?

    I wonder how hard it will be to turn on UEFI on a laptop.
  4. Lajos Juhász

    What is the difference??

    The first one will create TMyForm instance with no owner. While the second one creates an instance of TMyForm owned by the application object. In case the form is the first form created by the application it will make it the mainform of the application. For more detail open VCL.Forms.
  5. There is no data type TxQuery it's TxQuery<T: TDataset>. Unfortunately in Delphi you cannot have a class reference to a generic class. I've even tried this: type TFDxQuery = TxQuery<TFDQuery>; TxFDQueryClass = class of TFDxQuery ; an it also fails with [dcc32 Error] Unit1.pas(43): E2021 Class type required I would expect that TFDxQuery is a class.
  6. Lajos Juhász

    Round up to next $5

    There is a bug in the code it will round up 5 to 10 so it should be: function RoundUpToFive (AValue : Double) : double; var lTrunc: integer; lMod5: integer; begin lTrunc:=Trunc(Avalue); lMod5:=lTrunc mod 5; if lMod5 = 0 then result:=lTrunc else result:=lTrunc + 5 - lMod5; end; Another interesting case would be how to round up 5.99 should it be $5 or $10?
  7. Lajos Juhász

    base64 encode/decode  TStringDynArray

    You can read a file as a string: TemplateLines := TFile.ReadAllText(afilepath,Tencoding.UTF8 );
  8. Lajos Juhász

    Image attachment in a html email??

    You can find information here: https://www.indyproject.org/2005/08/17/html-messages/
  9. Lajos Juhász

    10.4.2 IDE crashes on start

    I do hope that you're aware that the IDE is still a 32 bit application and can't use additional memory.
  10. Lajos Juhász

    10.4.2 IDE crashes on start

    Delphi 10.4 was unstable however it never failed to load. Something that you've installed made the IDE unstable. As @Vandrovnik wrote you should try bds.exe -r foo.
  11. Lajos Juhász

    Using FDMemTable

    Place a break point in the DataModule most probably you didn't excecuted the code there and fdmAdmin.FieldDefs remains empty. That's the only way you get this error message.
  12. Lajos Juhász

    JCL installation problems in D10.4.2

    Before next time just send a pull request.
  13. Lajos Juhász

    JCL installation problems in D10.4.2

    There is a simple solution for this problem. Reorder the packages in the group, move the design time packages to the bottom.
  14. Is it valid to name en.delphipraxis.net as a platform where you can find answers to your Delphi related problems?
  15. Lajos Juhász

    Problem with Logging on to my.embarcadero.com

    Now it's also working for me.
  16. Lajos Juhász

    Problem with Logging on to my.embarcadero.com

    I cannot load the page: "This site can’t be reached".
  17. I've used that in my example and also it's better to implement the logic in AddObject as in the TStringList where method Add invokes Addobject with nil object.
  18. It really depends on the data for a list of 3-5 elements my guess is a list is faster.
  19. Your implementation of StrExists ignores the CaseSensitive property.
  20. Check out the source and you can easily write your own version (a quick example code): uses System.RTLConsts; type TMyStringList = class(TStringList) public function AddObject(const S: string; AObject: TObject): Integer; override; end; function TMyStringList.AddObject(const S: string; AObject: TObject): Integer; begin if sorted then result:=inherited AddObject(S, AObject) else begin result:=IndexOf(s); if (result=-1) then begin result:=count; InsertObject(result, S, AObject) end else begin case Duplicates of dupIgnore: Exit; dupError: Error(@SDuplicateString, 0); dupAccept: begin result:=count; InsertObject(result, S, AObject); end; end; end; end; end;
  21. No, there is no way and it's documented that Duplicates works only for sorted lists: Set Duplicates to specify what should happen when an attempt is made to add a duplicate string to a sorted list. The CaseSensitive property controls whether two strings are considered duplicates if they are identical except for differences in case. The value of Duplicates should be one of the following.
  22. Lajos Juhász

    Binary data in String?

    Try https://en.wikipedia.org/wiki/Windows-1251 one character is undefined hex 98. https://en.wikipedia.org/wiki/Windows-1250 there 5 undefined characters.
  23. Did you filled a bug report also with Microsoft? Delphi uses HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes\MS Shell Dlg 2 on my Windows 10 that's still Tahoma.
  24. Lajos Juhász

    Several F2084 Internal Error on Delphi 10.4.2

    If I remember correctly try ... finally was not effecting windows. I am using VCL for Windows so I could be still fine of course since I am enjoying my 2020 vacation I will test it in more details when I return to work.
  25. Lajos Juhász

    Several F2084 Internal Error on Delphi 10.4.2

    The patch is looking good after 3 minutes of testing 🙂
×