I want to write a codeunit that will calculate the sum of any integer value(N).
Lets say N=4, then sum =10(1+2+3+4)
My codes are as follows for the codeunit:
FOR i:=1 TO N DO BEGIN
IF (i<=N) THEN
The sum is not working when I put till N values. [:(]
This codeunit will be attached to a form whereby a value will be inserted by user, and generates the sum of that integer value. I cannot restrict users from the values they will input. It should cater for N values.