Re: HTA - Refresh



On Apr 30, 12:14 pm, "JHP" <goaways...@xxxxxxx> wrote:
I thought about that, but I wont be able to use it with this situation as
I'm parsing over 100,000 lines (a second per line adds over 27 hours).

Thank you for replying.

"Tom Lavedas" <tglba...@xxxxxxx> wrote in message

news:23fcad21-b73c-483d-bf39-679a34be94ab@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

On Apr 30, 9:33 am, "JHP" <goaways...@xxxxxxx> wrote:
No sure if this is the right forum. but I hope someone can help - I've
been
searching for an answer for days - and I bet it's something simple I have
over looked.

That said:

I have written a simple HTA script that iterates through parsing a text
file
by line, incrementing a Progress Bar. But because of the long process
the
background disappears if anything overlaps it, and a text <div> is not
updated.

How do I refresh (repaint) the HTA.

NB: The ProgressBar is "of Object" - and not affected:
<object classid="clsid:35053A22-8589-11D1-B16A-00C0F0283628"
id="ProgressBar1" height="20" width="400">

Thank you for any help, and reading through a long winded request.

This pausing your processing for a period of time to give the system
time to update the browser display. This is commonly done through the
setTimeout (or to a lesser extent the setInterval) functions provided
as part of the browser Document Object Model (DOM). The main feature
needed to make this work is that you process MUST take a break at each
point you want the display to be updated. Then the setTimeout kicks
in after the appropriate timeout and restarts the process. This is
pretty tricky to do and somewhat difficult for some people to
comprehend (it took me more than one try ;o).

Anyway, here is a sample I had laying around that illustrates on way
to do it ...

<html>
<head>
<script language=VBScript>
Sub StepWise(nStage)
Dim nPause

document.body.innerHTML = "Step " & nStage
nPause = 500 ' milliseconds
Select Case nStage
Case 1
setTimeout "StepWise " & nStage + 1, nPause, "VBScript"
Case 2
setTimeout "StepWise " & nStage + 1, nPause, "VBScript"
Case 3
setTimeout "StepWise " & nStage + 1, nPause, "VBScript"
Case 4
setTimeout "StepWise " & nStage + 1, nPause, "VBScript"
Case 5
document.body.innerHTML = "Done"
End Select

End Sub

</script>
</head>
<body onload="StepWise 1">
</body>
</html>

This is structured by stages, which by nature do different things. It
could also be a simple IF block around your whole loop process
instead, sometyhing like this ...

Sub Steps(nStep, nLimit)
Dim nPause

nPause = 50 ' milliseconds for example
if nStep <= nLimit then
' do process
' update progress
document.body.innerHTML = "Step " & nStep
else
GoToNextPartofProcess(Arguments, if, needed)
End Select

End Sub

HTH

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/

Why do you say it will add one second per line. It can be set to an
interval large enough to let the display update, but small enough to
minimize its impact.

In addition, you don't have to update the screen after every iteration
through the loop. Set it to happen every 100th time, instead.

Finally, as much as I admire mr unreliable's work, in general, I think
he's wrong about the Refresh. The issue is that your underlying
process is hogging all of the time available, such that the Refresh
can't take effect. Beside that, I think that a refresh should result
in the HTA returning to it's initialized state, that is like it was
just reloaded, not to the state at the time of the refresh. At least,
that's what would happen if you were to press the refresh key (F5) or
select the Refresh menu item in a browser window.

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
.



Relevant Pages

  • Re: Python CGI and Browser timeout
    ... so that the browser does not timeout. ... I saw some pages that display something like: ... and include a Refresh: header - the easiest way is to include a META tag in the html content section like ...
    (comp.lang.python)
  • Re: Is threading the right solution for this challenge?
    ... A typical screen "refresh" could take up to 10-15 ... the display thread (since it is only inquiring there is no danger ... interrupt itself to check for user input and react to it. ... In ACCEPT with TIMEOUT, what happens if the user was in the process of ...
    (comp.lang.cobol)
  • Re: Refreshing a Windows Form
    ... What you really need to do is call a method in the parent form that refresh ... refreshing the form is only repaint it, each control repaint itself using ... If the info that they need to display changed, you will have to update them, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Idea for new ttk Notebook virtual event
    ... preferred approach would be to automatically update the display via a timer ... may have gathered by now that your refresh via tab click is definitely not ... the notebooks using a common refresh) - the whole display will become ...
    (comp.lang.tcl)
  • Re: URI with anchor tag (#) does not work with IE 7 using WebBrowser
    ... bottom if I refresh the page manually. ... the page is displayed however it did not jump to the anchor ... The web page that we are trying to display is very simple but we need ... and jump to the proper anchor. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)

Quantcast