Jump to content

Kryvich

Members
  • Content Count

    402
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by Kryvich


  1. @Remy Lebeau

    It was a simplified snippet to highlight the problem. In my code I tried to use a repeat-until statement instead of a label and a goto statement. This statement is intended to direct an execution back to the top of code block in a special case. Now I add a control variable to bypass the check. 

      
      repeat
        var DoRepeat := False;
        ...
        if ... then begin
          ...
          if ... then begin
            DoRepeat := True;
            Continue;
          end;
          ...
        end;
        ...
      until not DoRepeat;
    • Like 1

  2. @Uwe Raabe Thank you.

    Although in my shining new Delphi 10.3.2 the wording is a little different: 

    Quote

    Allows the flow of control to proceed to the next iteration of for, while, or repeat statements. 

    In Delphi code, the Continue procedure causes the flow of control to proceed to the next iteration of the enclosing for, while, or repeat statement. 

    Moreover, in the IDE a little green arrow behind Continue suggests that the control flow will go to the beginning of the cycle.

    Repeat-Until-Loop-Screenshot.jpg.98003e26c755a09629fa3581ad04a88a.jpg


  3. I encountered a strange behavior when using the Continue procedure in a repeat statement. The simplified snippet:

    program RepContinue;
    {$APPTYPE CONSOLE}
    {$R *.res}
    var
      i: Integer;
    begin
      i := 5;
      repeat
        Writeln(i);
        Dec(i);
        if i > 0 then
          Continue;
      until True;
      Readln;
    end.

    It was expected that this program will print 5 numbers: "5 4 3 2 1". But in fact, it stops immediately after “5”.

    Is it a compiler error, or is it the way it should be?


  4. Check Build configuration in your project (Debug, Release). In a new project the build configuration is Debug by default.

    Then check Runtime errors settings for the current configuration in Project options | Building | Delphi compiler | Compiling. There is good reason to have all three settings (I/O, overflow, range checking) enabled for any type of Build configuration.

    • Like 1

  5. On 7/20/2019 at 5:47 PM, FredS said:

    I've set this up following your instructions on both a Windows 7 VM and a Windows 10 machine with IDE fix 6.4.2:

    image.thumb.png.5ccdd0d01bbddda10bf8c60daefacfaf.png

     

    On both it works!

    On my computer IDE Fix Pack showed 2 errors:

    IDEFixPackError1.jpg.f6139b2e1492f571c3eebff38546841c.jpg

    And this:

    IDEFixPackError2.jpg.4e2cb65bfdaf1aa0afefcfd2b1c11633.jpg

    So for me it was needed to disable two patches: 

    • Variable name: IDEFixPack.DisabledPatches
    • Variable Value: "CodeGenMod.Win32.FastFuncProlog";"VCL.Styles.StyleUtils"

    After this the messages are gone.

     

    • Like 1

  6. @mijn Same here. But I saved IDE settings before updating using Migration tool. So I still hope to install Delphi 10.3.1 without reinstalling all components.

     

    P.S. I uninstalled Delphi 10.3 and installed Delphi 10.3.1. All components are here. Only IDE Fix Pack had to be reinstalled.


  7. Of course, I can debug Delphi in Delphi. There is an exception:

    Quote

    First chance exception at $0B69F219. Exception class $C000001D with message 'system exception (code 0xc000001d) at 0x0b69f219'. Process bds.exe (4868)

    The debugger stopped here:

    0B69F215 F30F6F0A         movdqu xmm1,dqword ptr [edx]
    0B69F219 660F3817CB       ptest xmm1,xmm3  // <--------- here
    0B69F21E 0F8582000000     jnz $0b69f2a6
    0B69F224 660F6FE1         movdqa xmm4,xmm1

     


  8. Delphi shows "Error creating form: External exception C000001D." when I try to open one of my data modules. When I uninstall the IDE Fix Pack, the error disappears.

     

    I deleted all the code from the module, left only one memory table with a data source object, and the error is still here. Please see the files attached. Tested on Delphi Win 32-bit. IDE Fix Pack dev 2019-01-31-1645 for Delphi 10.3.

    uData.ZIP


  9. @Mike Torrettinni Check my demo app (attached). Works as needed in Windows 7 (I haven't Win10 here, sorry). Look at the project source:

    program SplashApp;
    uses
      SysUtils, Vcl.Forms,
      uSplashMain in 'uSplashMain.pas' {Form1},
      uSplashForm in 'uSplashForm.pas' {Form5};
    {$R *.res}
    begin
      Application.Initialize;
      Form5 := TForm5.Create(nil);
      try
        Application.MainFormOnTaskbar := True;
        Form5.Show;
        Form5.Update;
        Application.CreateForm(TForm1, Form1);
      Sleep(3000);
      finally
        Form5.Free;
      end;
      Application.Run;
    end.

    Form5 is a splash form, and Form1 is a app's main form. Also check menu Project | Options | Application | Forms. The splash Form5 is in the list of available forms (the right list).

    SplashApp.zip

    • Like 1
    • Thanks 1

  10. To tell the compiler the type of operand, I can advise the following:

    1. Replace array of Integer with TArray<Integer>. (In 10.3 Rio it is the same type.)
    2. Create a helper function:
    function AsArray(const [ref] Arr: TArray<Integer>): TArray<Integer>; inline;
    begin
      Result := Arr;
    end;
    ...
        b := r = AsArray([10]); // It compiles

     

×