return of events to code

  • I am attaching code of matrix and keypad 7 seg led дисплей. the program calls the owner and writes a file with name number equal to true and value . Before a new record the program writes "false" and after a second true again. Please advise me how to return to program events : incorrect number, respond on call, lock opening of, reset.