We help IT Professionals succeed at work.

Running total in a DOS loop

Steve4400
Steve4400 asked
on
Medium Priority
440 Views
Last Modified: 2012-06-27
I am having trouble creating a running total in a DOS loop.
this is what I have inside the loop:
     set total=%%H
     set /a tot=%total%+%%H
     echo. %tot%
total is initalized to zero
my results look like:
0+2346
0+4524
0+3987 ect.
Any help would be greatly appreciated.  Thanks.
Comment
Watch Question

Paolo SantiangeliConsulente Informatico
CERTIFIED EXPERT

Commented:
CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Worked!  Thanks very much.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.