2

I wrote this hybrid [Batch/Vbscript] (inspired by this code)

in order to simulate something like a typewriter !

But, i can't figure out how we can write in same line like a typewriter ?

@echo off
Set Message=Hi ! StackOverFlow !
@cScript.EXE //noLogo "%~f0?.WSF" "%Message%" //job:info %~nx0%*
pause
<job id="info">
<script language="VBScript">
strText=wscript.arguments(0)
intTextLen = Len(strText)
intPause = 100
For x = 1 to intTextLen
    strTempText = Mid(strText,x,1)
    wscript.echo strTempText
    WScript.Sleep intPause
    If intPause <= 500 Then
        intPause = intPause + 100
    Else
        intPause = 100
    End If
Next
</script>
</job>
Community
  • 1
  • 1
Hackoo
  • 18,337
  • 3
  • 40
  • 70

1 Answers1

4

You must write to the StdOut stream.

str = "hello world!"
For i = 1 To Len(str)
    WScript.StdOut.Write Mid(str, i, 1)
    WScript.Sleep 50
Next
Kul-Tigin
  • 16,728
  • 1
  • 35
  • 64