Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
Computer Hope forum e-mail issues and down time
0 Members and 1 Guest are viewing this topic.
echo Hiecho otherecho stuffecho here
set fred=echo%fred% Hi%fred% other%fred% stuff%fred% here
Is there a way I could stop writing echo so many times but NOT in a continuous line?
@echo offfor %%i in ("Hi" "Other" "Stuff" "Here") do echo %%~i
set string="1 Paris" "2 London" "3 Rome" "4 Madrid"for %%A in (%string%) do echo %%~A
So you don't like writing echo? Join the madhouse!Try this:Code: [Select]set fred=echo%fred% Hi%fred% other%fred% stuff%fred% here
@echo offset gosub=callset return=goto :eofecho main code%gosub% :subroutine%gosub% :subroutine%gosub% :subroutinepauseexit:subroutineecho in subroutine%return%
if you were brought up on BASIC you could do this to make yourself feel at home
Would that be IBM Basic assembly language for system 360?
@echo offCALL :ECHOS HI other stuff hereGOTO :EOF:ECHOS:ELOOPIF "%1"=="" GOTO :EOFecho %1SHIFTGOTO ELOOP