Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - wscript.echo only a new line / embed a "CR" in a text string ?

Reply
 
Old 03-31-2009   #1 (permalink)
Jerome Biau


 
 

wscript.echo only a new line / embed a "CR" in a text string ?

How can I output a simple new line CR in an existing wscript.echo command?

Ok, I could write:

wscript.echo "my output text"
wscript.echo

But isn't there a shorter way similar to "C":

wscript.echo "my output text\n"

or

wscript.echo "my output text" & CR

....which adds a second, additional new line CR at the end (so that a blank line is generated)?

Jerome


My System SpecsSystem Spec
Old 03-31-2009   #2 (permalink)
Pegasus [MVP]


 
 

Re: wscript.echo only a new line / embed a "CR" in a text string ?


"Jerome Biau" <j.biau@xxxxxx> wrote in message
news:49d20bce$0$31332$9b4e6d93@xxxxxx-online.net...
Quote:

> How can I output a simple new line CR in an existing wscript.echo command?
>
> Ok, I could write:
>
> wscript.echo "my output text"
> wscript.echo
>
> But isn't there a shorter way similar to "C":
>
> wscript.echo "my output text\n"
>
> or
>
> wscript.echo "my output text" & CR
>
> ...which adds a second, additional new line CR at the end (so that a blank
> line is generated)?
>
> Jerome
>
Try this:

LF = chr(10)
wscript.echo "Hello world", LF


My System SpecsSystem Spec
Old 03-31-2009   #3 (permalink)
Al Dunbar


 
 

Re: wscript.echo only a new line / embed a "CR" in a text string ?


"Pegasus [MVP]" <news@xxxxxx> wrote in message
news:ukv0V4fsJHA.2368@xxxxxx
Quote:

>
> "Jerome Biau" <j.biau@xxxxxx> wrote in message
> news:49d20bce$0$31332$9b4e6d93@xxxxxx-online.net...
Quote:

>> How can I output a simple new line CR in an existing wscript.echo
>> command?
>>
>> Ok, I could write:
>>
>> wscript.echo "my output text"
>> wscript.echo
>>
>> But isn't there a shorter way similar to "C":
>>
>> wscript.echo "my output text\n"
>>
>> or
>>
>> wscript.echo "my output text" & CR
>>
>> ...which adds a second, additional new line CR at the end (so that a
>> blank line is generated)?
>>
>> Jerome
>>
>
> Try this:
>
> LF = chr(10)
> wscript.echo "Hello world", LF
or these:

wscript.echo "Hello world", vbCRLF

wscript.echo "Hello world", vbCR
wscript.echo "Hello world", vbLF
wscript.echo "Hello world", vbNewLine

and you don't even have to assign those values as they are constants
pre-defined by vbscript.

/Al


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Can Wscript catch the MS Word Application Event "DocumentBeforePrint" ? VB Script
Chomp Echo String; No New Line Please! VB Script
WScript.Echo VB Script
How to change permanently the "Text Size" under "View"? Vista mail
Embed "Phone Call" button in a web page Live Messenger


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46