You could declare the variable "a" as global scope; var a: Integer; procedure TQuestion.tiInput(_Sender: TObject; _Event: TJSEvent); begin if ti.value = Answer then a := a + 1; end; -- Sent from: http://pas2js.38893.n8.nabble.com/