예제 #1
0
        //****************************************************************************************************
		public void Step(Subroutine.Moment pos, int forpos) {
			Namespace cn = InterprEnvironment.Instance.CurrentNamespace;
			VarBase res = cn[m_counter_var];
			if (!res.IsInt())
				throw new CalcException("“ип переменной - счетчика цикла был изменен");
			int resval = (res as IntVar).Val;
			resval++;
			res = new IntVar(resval);
			cn[m_counter_var] = res;
			if (resval > m_end_res.Val)
				pos.GoTo(m_next_pos + 1);
			else
				pos.GoTo(forpos + 1);
		}
예제 #2
0
        //****************************************************************************************************
		public void Execute(Subroutine.Moment pos) {
			VarBase resb, rese;
			resb = m_begin.Calculate();
			if (!resb.IsInt())
				throw new CalcException("√раницы изменени¤ счетчика должны быть целыми");
			IntVar resbi = resb as IntVar;
			Namespace cn = InterprEnvironment.Instance.CurrentNamespace;
			cn[m_counter_var] = resb;
			rese = m_end.Calculate();
			if (!rese.IsInt())
				throw new CalcException("√раницы изменени¤ счетчика должны быть целыми");
			m_end_res = rese as IntVar;
			if (resbi.Val > m_end_res.Val)
				pos.GoTo(m_next_pos + 1);
			else
				pos.Next();
		}
예제 #3
0
 public void Execute(Subroutine.Moment pos)
 {
     pos.GoTo(m_whilepos);
 }
예제 #4
0
        //****************************************************************************************************
		public void Execute(Subroutine.Moment pos) {
			pos.GoTo(m_nextpos + 1);
		}