Oooops:

> My personal preference for a case like this would be either to add a
> method to MainForm from to update the progressbar and call that from
> other code, e.g.:
>
> // in Main.pas
> type
>   TMainForm = class(TForm)
>     ProgressBar1 : TProgressBar;
>
>   public
>     procedure UpdateProgress(Value: Integer);
>   end;
>
> var
>   MainForm: TMainForm;
>
> implementation
>
> TMainFon.UpdateProgress(Value: Integer);
> begin
>   ProgressBar1.Position := Value;
> end;

That should read:

procedure TMainFon.UpdateProgress(Value: Integer);
begin
  ProgressBar1.Position := Value;
end;

Or (possibly better) make UpdateProgress an exported function of the unit:

// in Main.pas
type
  TMainForm = class(TForm)
    ProgressBar1 : TProgressBar;

  public
  end;

procedure UpdateProgress(Value: Integer);

var
  MainForm: TMainForm;

implementation

TMainFon.UpdateProgress(Value: Integer);
> begin
>   MainForm.ProgressBar1.Position := Value;
> end;

And that sould read:

procedure UpdateProgress(Value: Integer);
begin
  MainForm.ProgressBar1.Position := Value;
end;



Sorry folks.

Stephen Posey
[EMAIL PROTECTED]


_______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

Reply via email to