Jump to content

Lajos Juhász

Members
  • Content Count

    881
  • Joined

  • Last visited

  • Days Won

    12

Posts posted by Lajos Juhász


  1. 23 minutes ago, limelect said:

    Is it Delphi that gives me a beautiful day? 

     

    What I think there might have been hidden characters although no reason for it

     

    ..or just the current folder was not the one where the ini file is located.


  2. It's a normal behavior. You should give us more information in order to give us a chance to suggest how could you change the code.

     

    If you really have to use dmAutomatic in that case whenever you would like to cancel the drag operation you have to call the EndDrag method with false of the control (in this case the listbox).


  3. https://docwiki.embarcadero.com/Libraries/Sydney/en/System.Classes.TThread.Suspend

     

    Warning: Suspend is deprecated.

    Pauses a running thread. Suspend was intended to be used by debuggers and is deprecated in RAD Studio XE, in the year 2010.

    Call Suspend to temporarily halt the execution of the thread. To resume execution after a call to Suspend, call Resume. Calls to Suspend can be nested; Resume must be called the same number of times Suspend was called before the thread resumes execution.

    Warning: The Resume and Suspend methods should only be used for debugging purposes. Suspending a thread using Suspend can lead to deadlocks and undefined behavior within your application. Proper thread synchronization techniques should be based on TEvent and TMutex.

     


  4. Edit.text is unicode string so you should not use AnsiStrings for that. I tried your FindWordInTextStrUtils and in D11.1 get no deprecated warning:

    dcc32 command line for "Project1.dpr"
    [dcc32 Hint] Unit1.pas(30): H2164 Variable 's' is declared but never used in 'FindWordInTextStrUtils'
    Success
    Elapsed time: 00:00:00.7


  5. 21 minutes ago, Fons N said:

    Read this page, but not all of the links on this page work. 

     

    Am I just overlooking it, but I cannot seem to read anything about the Parnassus add-ins (specifically Bookmark.)...?

     

    Unfortunately I was able only to find promotion material for decision makers, not technical information for developers. Join the webinar later today and we should learn some information about the Bookmarks.


  6. 5 minutes ago, pyscripter said:

    When I added such a component to a data module in the 11.1 IDE an exception was raised.  It was working fine with 11.0.   Was I making a wrong assumption or is this an Alexandria 11.1 bug?

    It's not documented at https://docwiki.embarcadero.com/RADStudio/Sydney/en/Fields_(Delphi).

     

    PS. I am also in a couple of minutes will  install Delphi 11.1, hopefully I not going to see any new bugs.


  7. {irrelevant code removed}

     

    Most probably is relevant code. We cannot know what is the problem in your code without a simple test case. You're changing the data types of the parameters in your posts. You should post a test application where we can see what are you doing in the function and how you're calling it.


  8. 1 hour ago, PeterBelow said:

    That would be the equivalent of a Delphi Single. Use the good old Move procedure to copy the 4 bytes to a Single variable and pass that to FormatFloat to get a string representation.

    There is no need to copy the bytes using the absolute keyword the array and single can share the memory (like I posted).


  9. 1 minute ago, Uwe Raabe said:

    Don't you think that could be seen as a bit rude by the beta testers working on it for quite some weeks now?

    I was unaware that there is a beta testing (as it usually requires an NDA). In my defense never said that beta testers doesn't do their part of the work. But we already know that usually after the release there is a larger amount of tickets that stay opened.

     

    The only information from webinars I have that David Millington was beta testing some unreleased version of C++.

    • Like 1

  10. procedure TForm2.ComPort3RxChar(Sender: TObject);
    var
      Buffer3 : array[0..14] of Byte;
      Result3: array[0..3] of byte;
      s: single absolute result3;
      lstr: string;
    begin
      ComPort3.Read(@Buffer3,15);
      Move(Buffer3[7],Result3,4);
      lstr:=s.ToString;
    end;

     


  11. You can do the conversion using a record for example:

     

    type
      RfloatBytes=packed record
        case boolean of
            true:(floatVal:single);
            false:(byteVals:array[0..3] of byte);
        end;

     

    var

      x:  RfloatBytes;

     

    begin

      x.byteVals[0]:=%00000000;

      x.bytevals[1]:=%00000000;

      x.bytevals[2]:=%01001000;

      x.bytevals[3]:=%01000001;

      ShowMessage(x.floatVal.ToString);


     

    Or using an absolute keyword to share the memory (this is a Delphi 11 example for older versions you have to convert binary values into decimals or hex values):

     

    var
     x: array[0..3] of byte;
     s: single absolute x;
    begin
      x[0]:=%00000000;
      x[1]:=%00000000;
      x[2]:=%01001000;
      x[3]:=%01000001;
      ShowMessage(s.ToString);
    end;
     

     


  12. You should construct a search string. Something like this. I believe that Delphi is only coded between 32 and 127 stores as string.
     

    procedure TForm1.FormCreate(Sender: TObject);
    var
      x: string;
      i: integer;
      s: string;
    begin
      x:='1Булстат';
      s:='Caption = ';
      i:=1;
      while i<=length(x) do
      begin
        if (ord(x[i])>=32) and (ord(x[i])<=127) then
        begin
          s:=s+'''';
          while (i<=length(x)) and (ord(x[i])>=32) and (ord(x[i])<=127) do
          begin
            s:=s+x[i];
            inc(i);
          end;
          s:=s+'''';
        end
        else
        begin
          s:=s+'#'+IntToStr(ord(x[i]));
          inc(i);
        end;
      end;
      edit1.Text:=s;
    
    end;

     

×