本文介绍了cscript - 在控制台的同一行打印输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个cscript输出行到屏幕,如何避免每次打印后的换行符?

If I have a cscript that outputs lines to the screen, how do I avoid the "line feed" after each print?

示例:

for a = 1 to 10
  WScript.Print "."
  REM (do something)
next

预期输出应为: / p>

The expected output should be:

..........

不是:

.
.  
.
.
.
.
.
.
.
.

在过去,我已经用来打印向上箭头字符ASCII码。可以在cscript中完成吗?

In the past I've used to print the "up arrow character" ASCII code. Can this be done in cscript?

ANSWER

,没有额外的CR / LF

Print on the same line, without the extra CR/LF

for a=1 to 15
  wscript.stdout.write a
  wscript.stdout.write chr(13)
  wscript.sleep 200
next


推荐答案

使用wscript.stdout.write()而不是print。

Use wscript.stdout.write() instead of print.

这篇关于cscript - 在控制台的同一行打印输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 06:29