Jump to content

Ian Branch

Members
  • Content Count

    1274
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Ian Branch


  1. Hi haentschman,

    Not in my case.  I have been in and out of D-Rio multiple times and the libraries/components are still not enabled.

    Does it perhaps have something to do with the Saving and Desktop IDE setting?

    I have Autosave off for both the available options.

     

    There is a Delphi utility around somewhere that allows you to delete Delphi libraries/components, along with a lot of other Delphi related stuff, but I don't recall its name.

    Other than that, I have nothing to offer.

    Regards,

    Ian


  2. Hi Anders,

    Partially my fault, I initially thought it was the save action until I saw that it wasn't and it was in fact the close.

    YESSSS!!!!!!  All good now.  I disabled the 3 LiveBindings libraries and now the save/close all takes around 10 seconds. :-)

    Having now done that, I seem to recall a similar thing a couple of years ago.

     

    Note to self - Disable LiveBindings when any new Delphi comes along.

     

    Thanks Anders, and to all the other contributors.

    Regards,

    Ian

    • Like 2
    • Thanks 2

  3. Hi Team, et al,

    This has consumed too much of my time. 

    305 files, if I do a global component replace with GExperts, say TButton to TBitBtn, then save the project, the files save very quickly, it is the closing that takes around 13 minutes.

     

    As I can edit and do what I need to do in D2007, and save/close in under 30 secs, I will do all my updating there.

     

    Thank you all for your suggestions although some of them are out of my ken. ;-)

     

    Regards,

    Ian

    • Sad 1

  4. Hi Tomas,

    Yes, one core is being maxed out for a good % of its time. 

    Delphi itself is sitting at around 10% of CPU usage.

    As far as I can tell, I have disabled almost all IDE extensions with the exception of GExperts, of course. 

    Same 13 minutes to save/close.

    The project itself uses no 3rd Party libraries/components with the exception of DBISAM for the Database.

    The .dfm files are all text not binary.

    Regards,

    Ian

    Screenshot_3.png


  5. Hi Team,

    D10.3.1, 32Bit, Win 10 64Bit PC.

    I am running a pretty good Dev PC.

    I am working on a pretty large project, approx 305 .pas files/forms.

    If I make some changes  and tell Delphi to Close All, it can take more than 10 minutes before Delphi finishes and I can continue.

    There doesn't seem to be a lot happening as far as the PC itself is concerned, the CPU usage sits at around 12-13%.  See attached.

    Is there anything I can tweak to improve the save/close time?

    Regards & TIA,

    Ian

    Screenshot_1.png

    • Sad 1

  6. Hi Attila,

    The login form is called from and returns to the project .dpr file.

    begin
      //
      if TLogInForm.Execute then
      begin
        Application.Initialize;
        Application.CreateForm(TMainForm, MainForm);
        Application.Run;
      end
      else
      begin
        Application.MessageBox('You are not authorized to use the application.', 'Password Protected Delphi application');
      end;
    
    end.

    Regards,

    Ian

    • Like 1

  7. Hi Attila,

    Thank you your suggestions.

    I have removed the Form OnClose event.

    The DoLogin is returning the correct thing if the log in is invalid and failcount gets incremented, however the routine then drops out and it displays the Main Form rather than looping back to retry the user ID & password.

    Ian


  8. Hi Guys,

    I am trying to figure out how I can give the User 3 tries at logging in with the following code before exiting the Login form and throwing him/her out.

    The following is the basic code for the Login Form;

    class function TLogInForm.Execute: Boolean;
    begin
      //
      with TLogInForm.Create(nil) do
        try
          Result := ShowModal = mrOk;
        finally
          Free;
        end;
      //
    end;
    
    procedure TLogInForm.FormClose(Sender: TObject; var Action: TCloseAction);
    begin
      Action := caFree;
    end;
    
    procedure TLogInForm.btnCancelClick(Sender: TObject);
    begin
      ModalResult := mrCancel;
    end;
    
    procedure TLogInForm.btnOKClick(Sender: TObject);
    begin
      //
      if DoLogin then
        ModalResult := mrOk
      else
        ModalResult := mrCancel;
      //
    end;
    
    function TLogInForm.DoLogin: Boolean;
    begin
      //
      Result := False;
      //
      // Set The Engine, Session & Database parameters, if required.
      //
      //
      //
      // 'Condition' User ID & Password.
      sUserID := UpperCase(Trim(edtUserID.Text));
      sPassword := Trim(edtPassword.Text);
      //
      with tblUsers do
      begin
        Open;
        // Test for User ID is in DB.
        if not FindKey([sUserID]) then
        begin
          MessageDlg('User ID not found!', mtInformation, [mbOK], 0);
          Exit;
        end;
        //
        if Trim(FieldByName('UsrPasswrd').AsString) <> sPassword then
        begin
          MessageDlg('User''s password is invalid!', mtError, [mbOK], 0);
          Exit;
        end;
        //
      end;
      //
      Result := True;
      //
    end;

    Any assistance on how to do this is greatly appreciated.

    Regards & TIA,

    Ian


  9. Test for code..

    class function TLogInForm.Execute(const sDatabase: string): string;
    begin
      //
      MessageDlg('The database passed is..' + sDatabase, mtInformation, [mbOK], 0);
      //
      with TLogInForm.Create(nil) do
        try
          if ShowModal = mrOk then
            Result := edtUserID.Text
          else
            Result := '';
          // Result := ShowModal = mrOK;
        finally
          Free;
        end;
      //
    end;

    Ahhh.  I see.  Tks Remy


  10. Hi Team
    I am playing with calling a login form/dialog before the main form is created/run.  Based on work by Zarko Gajic. https://www.thoughtco.com/display-a-login-password-dialog-1058469
     

    program Passwordapp;
    
    uses
      Vcl.Forms,
      System.UITypes,
      MainFrm in 'MainFrm.pas' {MainForm} ,
      LogInFrm in 'LogInFrm.pas' {LogInForm};
    
    {$R *.res}
    
    begin
      //
      if TLogInForm.Execute then
      begin
        Application.Initialize;
        Application.CreateForm(TMainForm, MainForm);
        Application.Run;
      end
      ..
      ..


        The LoginForm is destroyed when closed.  It is no longer required.
     

    procedure TLogInForm.FormClose(Sender: TObject; var Action: TCloseAction);
    begin
      Action := caFree;
    end;



        I need to be able to preserve the UserID from the LogIn dialog.
        Is there a way to pass the UserID from the LogIn form back to the above and be able to then read it into the main form when it is created?

    Regards & TIA,
    Ian

    P.S. D10.3.1.


  11. Hi Team,

    I think, from time to time I have seen a function embedded in another function.  I think.

    Something like..

    function foobar(param1, param2: string): string;

    var

    somevar: string;

    begin

      function inside(Param3: string): string;

      var  anothervar: string;

      Begin  

        Do something with Param3;

        ....

        ...

        Result := anothervar;

      end;

    ...

    Somevar := inside(somestring);

    Result := Somevar;

    end;

    Is this doable?  If so, what is the mechanism for it pls?

    Why do I want to do this?  So I can embed a function in the main function and not have to have it as a separate app function.

     

    Regards & TIA,

    Ian

     

     


  12. Hi Guys,

    When I build my Apps I send the .exe files to an Applications folder for testing.

    When I do that, the .drc and .map files go there too.

    Is there any way to have the .drc & .map files stay in the source/development directory, or somewhere else, rather than the Apps directory?

    Regards & TIA,

    Ian

×