compile when I get the message ' setLocked ' was not Declared In This scope

Compiler is right. setLocked is not declared in your code, but you have codigosecreto and other variables declared.