changes: 1. declare an error if not within a class 2. declare an error if within a procedure/function 3. declare an error in object (implies missing end_object) Note: it is possible that under advanced usage you might be creating a class in a method. If this is the case you should use base_end_class
#IF (!b & 2) // must be within class or an error #IF (!b & 4) // end-class within procedure is probably wrong #ERROR DFERR_COMP_ILLEGAL_CODE_PLACEMENT CLASS/END_CLASS should .not. be inside a method #ELSE #IF (!b & 1) // if object must be error. Should be end object #ERROR DFERR_COMP_ILLEGAL_CODE_PLACEMENT End_object expected before End_class #ENDIF BASE_END_CLASS #ENDIF #ELSE #ERROR DFERR_COMP_ILLEGAL_CODE_PLACEMENT End_class without class #ENDIF