package nxm.sys.intr;

import nxm.sys.lib.Intrinsic;
import nxm.sys.lib.Parser;

/** Handles command verification functions.

    @author Jeff Schoen
*/
public class Verify extends Intrinsic implements nxm.sys.inc.Verify {

  /** default constructor */
  public Verify () {}

  public int open() {
    if (!MA.find("STATE")) {
      nxm.sys.intr.Results.listSingleResult(M,M.results,"ENV.VERIFY",0,true);
      return FINISH;
    }

    boolean state = MA.getZ("STATE");
    String  func  = MA.getS("FUNC");

    if (state) M.setVerify("+"+func);
    else       M.setVerify("-"+func);

    MR.put("ENV.VERIFY",Parser.mask2s(verifyList,M.verify),nxm.sys.lib.Table.FORCE);

    return NORMAL;
  }
}
