Einzelnen Beitrag anzeigen

question

Registriert seit: 17. Apr 2013
97 Beiträge
 
#1

problem with accessing value

  Alt 24. Aug 2013, 11:25
Dear All,
I have two units, Unit1 and Unit2 , i would like to access a boolean from Unit1 to Unit2 , i have tried it in the following way, but i have got the error "Zugriffsverletzung bei Adresse 023C4B58 in Modul 'Test.exe'. Lesen von Adresse 0000"

Code:
//Unit1
Unit Unit1
type TCalculation = class(TForm)
  private
  protected
   FNewvalue: Boolean;
  public
   property Newvalue: Boolean read FNewvalue;
   
  end;

//Unit2
Unit Unit2
type Taccounts = class(TForm)

 interface

uses
  Unit1
   
  private
  protected
  public
    procedure Checkvalue(Sender: TObject);
  end;

implementation

procedure Taccounts .Checkvalue(Sender: TObject);
var
  f : TCalculation ; // i have created an instance of TCalculation    
begin
if f.Newvalue = True then // i have called the boolean
//check the condition
End;
could you please tell me ,how can i make it works?
  Mit Zitat antworten Zitat