Statement is only valid within a class definition (Error 1928)

PROTECTED, ADD OBJECT, and ADD PROTECTED OBJECT commands are valid only within a class definition. For more information, see DEFINE CLASS.