Advertisement
Um_nik

Untitled

Oct 15th, 2014
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. @echo off
  2.  
  3. if %1=="/?" goto :help
  4.  
  5. setlocal
  6.  
  7. if %1==""
  8. goto :readEq
  9. else do
  10. goto :main
  11.  
  12.  
  13. :readEq
  14. echo Type the equation, please
  15. rem READ
  16.  
  17. :main
  18.  
  19. set var=""
  20.  
  21. :loop
  22. if ("%1"=="") goto :solve
  23. set var += %1
  24. shift
  25. goto :loop
  26.  
  27. :solve
  28. set /a res = var
  29. if errorlevel==0
  30. echo Result = %res%
  31. else do
  32. echo Incorrect Equation
  33.  
  34. goto :eof
  35.  
  36. :help
  37. echo This is help for you, dunno
  38. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement