Hi im kind of a newbie in batching i want to write a little program the will basicly will canculate Ohm's law here it is its not finished becuse it always goback to :resistent
@echo off
color b
:pstart
Set input
set /p input=Enter Resistent,Influx,Vault (R,I,V):
if %input%==R goto resistent
if %input%==I goto influx
if %input%==V goto vault
:resistent
set voltege
set /p voltege=Enter volts:
set current
set /p current=Enter current:
set /a Result=%voltege%/%current%
echo %Result%
:influx
set voltege
set /p voltege=Enter volts:
set resist
set /p resist=Enter resistnet:
set /a Result=%voltege%/%resistnet%
echo %Result%
thanks very much for helpers
plz help !
Moderator: DosItHelp
Re: plz help !
untested:
Regards
aGerman
Code: Select all
@echo off
color b
:pstart
Set "input="
set /p "input=Enter Resistent,Influx,Vault (R,I,V): "
if /i "%input%"=="R" goto resistent
if /i "%input%"=="I" goto influx
if /i "%input%"=="V" goto vault
echo Wrong input.
goto pstart
:resistent
set "voltege="
set /p "voltege=Enter volts: "
set "current="
set /p "current=Enter current: "
set /a Result=%voltege%/%current%
echo %Result%
pause
goto :eof
:influx
set "voltege="
set /p "voltege=Enter volts: "
set resist
set /p "resist=Enter resistnet: "
set /a Result=%voltege%/%resistnet%
echo %Result%
pause
goto :eof
:vault
REM Whatever you wanna do here.
Regards
aGerman