Batch IF Statement Limit/Issue -


hey viewing this! so, i'm having problem batch code have been writing (see below). i'm trying make around desktop assistant that's easy use , simple. that's not problem. problem focused around "define" feature of program. whenever testing file, can of current definitions ab, list cuts off (see representation of output). space definitions should blank. also, keep in mind know isn't practical, want code simple possible.

@echo off   :processes color 0a title kapua, virtual assistant cd ./info set /p name=<name.txt set /p food=<food.txt set /p color=<color.txt set /p game=<game.txt set /p friend=<friend.txt set /p movie=<movie.txt   :start cls echo. echo kapua, virtual assistant echo. pause goto welcome   :welcome cls echo. echo welcome, %name%! echo. pause cls goto main   :main echo. echo enter command. echo type "help" commands. echo. goto line   :line set /p command=">" if not defined command ( echo. echo pardon? echo. set command= goto line ) if %command% == ( set command= goto ) if %command% == define ( set command= goto define ) if %command% == clear ( set command= goto clear )   :help echo. echo current available commands , functions: echo. echo "help" - displays current available commands , functions echo "define" - defines word echo "clear" - clears current screen echo. goto line   :clear cls echo. goto line   :define echo. echo please type word want defined below. echo please use proper capitalization , punctuation! (example: don't,  echo aphrodite, et cetera) echo abbreviations, such u.s.a. or e.u., don't include periods!  echo (example: usa) echo. set /p word=">" if not defined word ( echo. echo pardon? set word= goto define )  if %word% == ( echo. echo noun: 1. first letter of alphabet echo. echo indefinite article/adjective: 1. one; 1 sort of echo                               2. each; 1 echo. echo prefix: 1. in, into, on, at, echo         2. in act or state of echo         3. up, out echo         4. off, of echo         5. not, without echo. echo *used before words beginning consonant sound echo. set word= goto line )  if %word% == ( echo. echo noun: 1. blood type echo       2. grade indicating excellence echo       3. sixth tone in scale of c major echo. set word= goto line )  if %word% == aa ( echo. echo abbreviation: 1. alcoholics anonymous echo               2. associate in/of arts echo. set word= goto line )  if %word% == aardvark ( echo. echo noun: 1. nocturnal, ant-eating african mammal echo. set word= goto line )  if %word% == aaron ( echo. echo noun: first high priest of hebrews  cho. set word= goto line )  if %word% == ab ( echo. echo noun: 1. blood type echo. echo abbreviation: 1.bachelor of arts echo               2. alberta (canada) echo. set word= goto line )  if %word% == ab ( echo. echo prefix: 1. away, from, off, down echo. set word= goto line )  if %word% == aba ( echo. echo abbreviation: 1. american bar association echo. set word= goto line )  if %word% == aback ( echo. echo adverb: 1. backward, echo. set word= goto line )  if %word% == abacus ( echo. echo noun: 1. frame sliding beads doing arithmetic echo. echo plural: 1. abacuses echo         2. abaci echo. set word= goto line )  if %word% == abaft ( echo. echo adverb: 1. in or behind stern of ship echo. echo preposition: 1. nearer stern than; behind echo. set word= goto line )  if %word% == abalone ( echo. echo noun: 1. edible sea mollusk oval, spiral shell echo. set word= goto line ) 

output (for sake of variables substituted random stuff):

kapua, virtual assistant

press key continue...

(screen clears)

welcome, tom!

press key continue...

(screen clears)

enter command. type "help" commands.

define

please type word want defined below. please use proper capitalization , punctuation! (example: don't, aphrodite, et cetera) abbreviations, such u.s.a. or e.u., don't include periods! (example: usa)

aardvark

noun:1 nocturnal, ant-eating african mammal

define

(same thing above)

aba

>

so, can me solve this? thanks!

in definition "ab", closing parenthesis in "(canada)" closing if statement , putting set word= , goto line outside of conditional, means gets run once pick word past "ab."

to around this, use ^ escape close parenthesis.

echo 2. alberta (canada^)  

Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -