Statement is not in a procedure (Error 1931)

Statements are not allowed after the ENDPROC clause. For more information, see DEFINE CLASS.