4 Replies Latest reply on Sep 11, 2012 12:03 PM by George_Johnson

    Can you help me write less repetitive code?

    JBJgetAfield

      I'm a relative novice at writing javaScript and I wonder if there is a more efficient way to write the below code.

       

      this.getField("Rx.0").fillColor = color.black;

      this.getField("Rx.1").fillColor = color.white;

      this.getField("Rx.2").fillColor = color.white;

      this.getField("Rx.3").fillColor = color.white;

      this.getField("Rx.4").fillColor = color.white;

      this.getField("Rx.5").fillColor = color.white;

      this.getField("Rx.6").fillColor = color.white;

      this.getField("Rx.7").fillColor = color.white;

      this.getField("Rx.8").fillColor = color.white;

      this.getField("Rx.9").fillColor = color.white;

      this.getField("Rx.10").fillColor = color.white;

      this.getField("Rx.11").fillColor = color.white;

       

      this.getField("Rx.0").textColor = color.white;

      this.getField("Rx.1").textColor = color.black;

      this.getField("Rx.2").textColor = color.black;

      this.getField("Rx.3").textColor = color.black;

      this.getField("Rx.4").textColor = color.black;

      this.getField("Rx.5").textColor = color.black;

      this.getField("Rx.6").textColor = color.black;

      this.getField("Rx.7").textColor = color.black;

      this.getField("Rx.8").textColor = color.black;

      this.getField("Rx.9").textColor = color.black;

      this.getField("Rx.10").textColor = color.black;

      this.getField("Rx.11").textColor = color.black;

       

       

      this.getField("CervQ.0").value = "0";