Batch File Calculator

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

goofman

Thread Starter
Joined
Sep 4, 2004
Messages
47
:mad: --------------------------------------------------------------------------------

hi all, im creating a batch file calculator...except when i run it and type in something like 3+2e the answer doesnt come up, o yea, it only goes up to 10 caus ethats a lot of typing! but i--o nvm, its hard to explain, heres the code!!:
echo off
title Calculator
cls
:start
echo.
echo.
echo 1 2 3
echo.
echo 4 5 6
echo.
echo 7 8 9
echo.
echo 0
echo + -
echo.
echo e
echo.
set choice:
set /p choice= Just use this like a normal Calculator...NOTE: e= Equals
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='0+0e0' echo 0
if '%choice%'=='1+0e1' echo 1
if '%choice%'=='0+1e1' echo 1
if '%choice%'=='2+0e2' echo 2
if '%choice%'=='0+2e2' echo 2
if '%choice%'=='1+2e3' echo 3
if '%choice%'=='2+1e3' echo 3
if '%choice%'=='3+0e3' echo 3
if '%choice%'=='4+0e4' echo 4
if '%choice%'=='3+1e4' echo 4
if '%choice%'=='1+3e4' echo 4
if '%choice%'=='2+2e4' echo 4
if '%choice%'=='2+3e5' echo 5
if '%choice%'=='3+2e5' echo 5
if '%choice%'=='4+1e5' echo 5
if '%choice%'=='1+4e5' echo 5
if '%choice%'=='5+0e5' echo 5
if '%choice%'=='5+1e6' echo 6
if '%choice%'=='1+5e6' echo 6
if '%choice%'=='4+2e6' echo 6
if '%choice%'=='2+4e6' echo 6
if '%choice%'=='3+3e6' echo 6
if '%choice%'=='6+0e6' echo 6
if '%choice%'=='0+6e6' echo 6
if '%choice%'=='6+1e7' echo 7
if '%choice%'=='1+6e7' echo 7
if '%choice%'=='5+2e7' echo 7
if '%choice%'=='2+5e7' echo 7
if '%choice%'=='4+3e7' echo 7
if '%choice%'=='3+4e7' echo 7
if '%choice%'=='7+0e7' echo 7
if '%choice%'=='0+7e7' echo 7
if '%choice%'=='7+1e8' echo 8
if '%choice%'=='1+7e8' echo 8
if '%choice%'=='5+3e8' echo 8
if '%choice%'=='3+5e8' echo 8
if '%choice%'=='4+4e8' echo 8
if '%choice%'=='6+2e8' echo 8
if '%choice%'=='2+6e8' echo 8
if '%choice%'=='8+0e8' echo 8
if '%choice%'=='0+8e8' echo 8
if '%choice%'=='9+0e9' echo 9
if '%choice%'=='0+9e9' echo 9
if '%choice%'=='8+1e9' echo 9
if '%choice%'=='1+8e9' echo 9
if '%choice%'=='7+2e9' echo 9
if '%choice%'=='7+2e9' echo 9
if '%choice%'=='6+3e9' echo 9
if '%choice%'=='3+6e9' echo 9
if '%choice%'=='5+4e9' echo 9
if '%choice%'=='4+5e9' echo 9
if '%choice%'=='10+0e10' echo 10
if '%choice%'=='0+10e10' echo 10
if '%choice%'=='9+1e10' echo 10
if '%choice%'=='1+9e10' echo 10
if '%choice%'=='8+2e10' echo 10
if '%choice%'=='2+8e10' echo 10
if '%choice%'=='7+3e10' echo 10
if '%choice%'=='3+7e10' echo 10
if '%choice%'=='4+6e10' echo 10
if '%choice%'=='6+4e10' echo 10
if '%choice%'=='5+5e10' echo 10
:0+0e0
goto start
:1+0e1
goto start
:0+1e1
goto start
:2+0e2
goto start
:0+2e2
goto start
:1+2e3
goto start
:2+1e3
goto start
:3+0e3
goto start
:4+0e4
goto start
:3+1e4
goto start
:1+3e4
goto start
:2+2e4
goto start
:2+3e5
goto start
:3+2e5
goto start
:4+1e5
goto start
:1+4e5
goto start
:5+0e5
goto start
:5+1e6
goto start
:1+5e6
goto start
:4+2e6
goto start
:2+4e6
goto start
:3+3e6
goto start
:6+0e6
goto start
:0+6e6
goto start
:6+1e7
goto start
:1+6e7
goto start
:5+2e7
goto start
:2+5e7
goto start
:4+3e7
goto start
:3+4e7
goto start
:7+0e7
goto start
:0+7e7
goto start
:7+1e8
goto start
:1+7e8
goto start
:5+3e8
goto start
:3+5e8
goto start
:4+4e8
goto start
:6+2e8
goto start
:2+6e8
goto start
:8+0e8
goto start
:0+8e8
goto start
:9+0e9
goto start
:0+9e9
goto start
:8+1e9
goto start
:1+8e9
goto start
:7+2e9
goto start
:7+2e9
goto start
:6+3e9
goto start
:3+6e9
goto start
:5+4e9
goto start
:4+5e9
goto start
:10+0e10
goto start
:0+10e10
goto start
:9+1e10
goto start
:1+9e10
goto start
:8+2e10
goto start
:2+8e10
goto start
:7+3e10
goto start
:3+7e10
goto start
:4+6e10
goto start
:6+4e10
goto start
:5+5e10
goto start


so whats wrong, how come the answer doesnt show uP!!!
 

JohnWill

Retired Moderator
Joined
Oct 19, 2002
Messages
106,429
Good GRIEF! :eek: Why don't you pick up something like Visual Basic and do the calculator the easy way? :confused:
 

goofman

Thread Starter
Joined
Sep 4, 2004
Messages
47
haha, lol, but i already started this and it would make me feel better if i finished it, and there is like no visual basic copies anywhere where i live, except theres everything else! and i like ms-dos, i started ASM language but its like chinese! so can someone help me!!?
 

goofman

Thread Starter
Joined
Sep 4, 2004
Messages
47
also when I try to make it into a .COM file with bat2exe it gives me an error like the labe has already been used once or whatever,s oemthign liek that.
 

JohnWill

Retired Moderator
Joined
Oct 19, 2002
Messages
106,429
If you really want to build a calculator, try AutoIt, I can't imagine trying to do it with batch commands!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top