Advertisement
Um_nik

Untitled

Oct 15th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 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
  10. (
  11. goto :main
  12. )
  13.  
  14.  
  15. :readEq
  16. echo Type the equation, please
  17. rem READ
  18.  
  19. :main
  20.  
  21. set var=""
  22.  
  23. :loop
  24. if ("%1"=="") goto :solve
  25. set var+=%1
  26. shift
  27. goto :loop
  28.  
  29. :solve
  30. set /a res=var
  31. if errorlevel==0 (
  32. echo Result = %res%
  33. ) else
  34. (
  35. echo Incorrect Equation
  36. )
  37.  
  38. goto :eof
  39.  
  40. :help
  41. echo This is help for you, dunno
  42. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement