bat to change input to another character

Dell / Dimension 4600i...
December 7, 2010 at 15:16:15
Specs: Microsoft Windows XP Home Edition, 2.793 GHz / 1534 MB
Below is a bat that I am working on. The end result is a program that will convert input to morse code....
example: if input is "a" then .- would be echoed to the test.doc


cls
echo this is an input bat
set INPUT=
set /P INPUT=Type input: %=%
echo Your input was: %INPUT%
pause
if %INPUT% =a echo .- >>test.doc
pause

Would appreciate any help.
So far echo %INPUT% >>test.doc works
but the if %INPUT% =a echo .- >>test.doc
doesn't


See More: bat to change input to another character

Report •

#1
December 7, 2010 at 16:08:50
ouch missing a =
if %INPUT% =a echo .- >>test.doc

if %INPUT% == a echo .- >>test.doc


Report •

#2
December 8, 2010 at 03:24:41
if %INPUT% == a echo .- >>test.doc

Is testing for equality of two strings:

the content of the var INPUT FOLLOWED BY A SPACE
the char a PRECEEDED BY A SPACE


=====================================
Life is too important to be taken seriously.

M2


Report •
Related Solutions


Ask Question