BenChristian
IS-IT--Management
I'm putting togehter an HTA and have come across an issue. The script won't update the actual HTA (a span area) until it has finished.
I've listed a simple example below. I would like to display the text in the span area before the script finishes, but as you will see if you run the HTA, the span area doesn't actually update until the sciprt finishes. If I place a msgbox function between updating the span area and starting the Do.. Loop then the span area is updated immediately (which seems to be because the script has been interrupted).
The HTA that I am writing uses a For Next loop, and for each iteration of the loop I want to update the span area with something lile "processing line 1 of 989". I have the same issue if I try and upate a text area.
I'd really appreciate any input or suggestions, I've been stuck on this issue for a few days now!
Many thanks.
I've listed a simple example below. I would like to display the text in the span area before the script finishes, but as you will see if you run the HTA, the span area doesn't actually update until the sciprt finishes. If I place a msgbox function between updating the span area and starting the Do.. Loop then the span area is updated immediately (which seems to be because the script has been interrupted).
Code:
<html>
<head>
<Title>Test HTA Application</Title>
<HTA:APPLICATION
ID = "HTAapp"
APPLICATIONNAME = "Test HTA Application"
BORDER = "thick"
CAPTION = "yes"
ICON = "app.ico"
SHOWINTASKBAR = "yes"
SINGLEINSTANCE = "yes"
SYSMENU = "yes"
WINDOWSTATE = "normal"
SCROLL = "no"
SCROLLFLAT = "yes"
VERSION = "1.0"
INNERBORDER = "yes"
SELECTION = "no"
MAXIMIZEBUTTON = "yes"
MINIMIZEBUTTON = "yes"
NAVIGABLE = "yes"
CONTEXTMENU = "yes"
BORDERSTYLE = "normal"
>
</head>
<script language="vbscript">
Sub btnStart_onClick
'Output to the HTA by updating the "testpan" SPAN area
testspan.innerhtml = "Test output before Do.. Loop"
'Create a delay by using a loop. There's no sleep command with vbscript inside an HTA
strResume = Second(now()) + strDelay
Do until Second(Now()) > strResume
Loop
msgbox "End of Do.. Loop routine"
End Sub
</script>
<body>
<INPUT TYPE="Button" NAME="btnStart" VALUE="Start"><br>
<span id = "testspan"></span>
</body>
<html>
The HTA that I am writing uses a For Next loop, and for each iteration of the loop I want to update the span area with something lile "processing line 1 of 989". I have the same issue if I try and upate a text area.
I'd really appreciate any input or suggestions, I've been stuck on this issue for a few days now!
Many thanks.