$$$$ REPE NOTICE CHAT 11/09/12 21:17:56 7124 DATE 11/09/12 Directive REPETER Voir aussi : ITER QUIT ----------------- FIN REPETER BLOC1 ( N1 ) ; Description : _____________ The BLOC1 object of BLOC type is composed of the set of instructions ranging between the REPETER BLOC1 instruction and the FIN BLOC1 instruction. The REPETER instruction enables the user to repeat N1 times (ENTIER type) the execution of this set of instructions. An ENTIER object called BLOC1 is automatically generated; it contains the number of times the BLOC has been in execution, it can therefore serve as a repetition counter. ATTENTION only the seven first letters of BLOC1 are taken and put after the &. Note : ________ If N1 is specified, it is required that it be mentioned after the loop. If N1 is negative or zero, the repetition will continue indefinitely. If N1 is not specified, the repetition will continue indefinitely. It is possible to interrupt the process by means of the QUITTER instruction. . Example : Calculation of Euler's constant: _________ I=0 ; CRIT= 1E-5; CRITM= CRIT*-1; C=0. ; EPS1= 0 ; OK = FAUX ; REPETER BLOTO 100 ; I = I + 1; C = C + (1./ I) ; EPS = C - (LOG I) ; D = EPS - EPS1 ; SI ( (D < CRIT) ET (D > CRITM) ) ; OK = VRAI ; MESS ' Euler's constant reached after ' BLOTO 'iterations'; QUITTER BLOTO ; FINSI ; EPS1 = EPS ; FIN BLOTO ; SI OK ; LIST EPS ; SINON ; MESSAGE 'RATE' ; FINSI ; FIN;
© Cast3M 2003 - All rights reserved.
Disclaimer