[Pas2js] how to access variables between various procedures

Michael Van Canneyt michael at freepascal.org
Mon Sep 14 20:46:43 CEST 2020



On Mon, 14 Sep 2020, Mgr. Janusz Chmiel wrote:

> I have found myself in The complex problem.
> How to access The variable which is being declared and used in
> procedure TQuestion.tiInput( _Sender: TObject; _Event: TJSEvent);
> in The following other procedure:
> procedure TMyApplication.doRun;
> I have declared integer variable in The
> procedure TQuestion.tiInput( _Sender: TObject; _Event: TJSEvent);
> and I want to access this variable content in The
> procedure TQuestion.tiInput( _Sender: TObject; _Event: TJSEvent);
> It is impossible for Me and I Am very sad because of it.
> Is it possible to share variable content between various procedures?

You must declare these variables outside the methods, as fields of the
TQuestion class.

Michael.


More information about the Pas2js mailing list