$ 0 0 Got it! Actually dere is problem in looping only... NoOfLoops := ABS(NoOfCopies) ; instead of NoOfLoops := ABS(NoOfCopies) + 1;