Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: how to supress newline?  (Read 2581 times)

0 Members and 1 Guest are viewing this topic.

wthom

  • Guest
how to supress newline?
« on: May 02, 2005, 12:25:37 AM »
Is there any way for me to display two echo result on the same line?
Thanks !

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: how to supress newline?
« Reply #1 on: May 02, 2005, 07:12:19 AM »
It depends on the context of where ECHO is used. On the command line you can display defined environment variables (%var%) and literals. Within a batch file you can display passed parameters (%1 thru %9), defined environment variables (%var%), variables generated within the scope of a  FOR statement (%%a thru %%z), and literals.

If you put two ECHO commands on the same line, the second ECHO will be treated as a literal.

You could always use DEBUG and create your own assembly language program for your own needs.

Hope this helps.
8)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

wthom

  • Guest
Re: how to supress newline?
« Reply #2 on: May 02, 2005, 07:24:06 AM »
I've just found an workaround to get the same result:

set /p dummy="this is the 1st line" <nul
echo "this is the 2nd line"

And you will get these 2 lines goes together!  :D

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: how to supress newline?
« Reply #3 on: May 02, 2005, 07:33:40 AM »
I'm always happy when people find their own solutions. There is always more than one way to accomplish the same thing on a PC.

Good luck.  ;D
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein