I'm trying to create a 1 line code where it adds up all variables its hard to explain in text right but here's a small part of the code
H = hours
M = Minutes
Thr = Total Hours
Tmin= Total Minutes
Call data.bat
Rem data.bat is all the h1,m1,h2,m2,h3,m3... info
Rem Example Data
H1=3
M1=53
H2=4
M2=20
Set num=1
:refresh
if %H%num%% GTR 0 set /a Thr=%H%num%%+%Thr%
if %M%num%% GTR 0 set /a Thr=%M%num%%+%TMin%
if %M%num%% EQU 0 Goto :total
set /a number=%number%+1
goto :refresh
:Total
set /a Total=((%Thr%*60)+%Tmin%)
set /a TotalHour=(%Total%/60)
set /a TotalMin=(-%TotalHour%*60)+%Total%
if %Totalmin% GEQ 0 if %Totalmin% LEQ 9 set Totalmin=0%Totalmin%
Echo Duration : %TotalHour%hr %TotalMin%min
Hours does not have if 0 goto total because there may be times where there was 0 hours but ##'s minutes Any Ideas on how to do this? Running it as is gives me
step by step operation
if %h%num%% gtr 0 set /a Thr=%h%num%%+%thr%
If %h1% gtr 0 set /a thr=%h1%+%thr%
If 3 gtr 0 set /a thr=**3+%thr%
if 3 gtr 0 set /a thr=3+1