I made this simple html application using vbscript.
<html>
<head>
<title>Example</title>
<script type="text/vbscript" src="scr1.vbs"></script>
<script type="text/vbscript" src="scr2.vbs"></script>
</head>
<body>
<p>Example</P>
<button onClick="scr1">scr1</button>
<button onClick="Scr2()">scr1</button>
</body>
</html>
Now script1 and 2 both takes lot of time to complete. While one of the script is running the application hangs. Is there any way I can do it async.
vbscripts are similar to this.
Set fso = CreateObject("Scripting.FileSystemObject")
For Each oFile In fso.GetFolder(sFolder).Files
If LCase(fso.GetExtensionName(oFile.Name)) = "txt" Then
set oFile = fso.OpenTextFile(oFile)
Do While oFile.AtEndOfStream <> True
TextLine = TextLine & oFile.ReadAll
Loop
End if
Next
Set regEx_ = new regExp
With regEx_
.Global = True
.MultiLine = True
.IgnoreCase = True
.Pattern = "pattern 1"
TextLine = regEx_.replace(TextLine, "mmrk$&")
.Pattern = "pattern 2"
TextLine = regEx_.replace(TextLine, "mmrk$&")
'and 100 more such complex regex replaces
End With
set Temp = fso.CreateTextFile(TempFile, True)
Temp.Write TextLine
Temp.Close
Set Temp = Nothing
Is there any scope here also to make it async?