PROCEDURE MyProc(aSomeArray AS Variant) AS Boolean HELPString "This method does..." WITH This IF PCOUNT() = 1 IF TYPE("aSomeArray[1]") # T_UNDEFINED ** Code for this method goes here ELSE ERROR 232, "aSomeArray" && 'aSomeArray' is not an array ENDIF ELSE ERROR 1229 && Too few arguments ENDIF ENDWITHProblem is, this is a lot of code for only 1 parameter. With methods that take 4 or 5 parameters, this
PROCEDURE MyProc(aSomeArray AS Variant) AS Boolean HELPString "This method does..." WITH This IF .CheckParams("MyProc", @aSomeArray) ** Code for this method goes here ENDIF ENDWITH HIDDEN PROCEDURE CheckParams(sProcName, p1, p2, p3, p4, p5) AS Boolean LOCAL bRetVal AS Boolean bRetVal = TRUE WITH This DO CASE CASE sProcName = "MyProc" DO CASE CASE TYPE("p1") # T_LOGICAL ERROR 1229 && Too few arguments bRetVal = TRUE CASE TYPE("p1[1]") # T_UNDEFINED ERROR 232, "aSomeArray" && 'aSomeArray' is not an array bRetVal = TRUE ENDCASE ENDCASE ENDWITH RETURN bRetVal ENDPROCI welcome any thoughts/input on this.