private int validMacro(String s){
  int mN;
  try {
    mN=Integer.parseInt(s);
  }
 catch (  NumberFormatException e) {
    return -1;
  }
  if (mN < 0 || mN > maxNumMacros) {
    return -1;
  }
 else {
    return mN;
  }
}

private int validMacro ( String s ) { int mN ; try { mN = Integer . parseInt ( s ) ; } catch ( NumberFormatException e ) { return - 1 ; } if ( mN < 0 || mN > maxNumMacros ) { return - 1 ; } else { return mN ; } }
check for valid macro , return number if valid , - 1 if not .
