How can i implement a progress bar in the status bar with NEMProgress… functions as in the previous versions (R5.x)?
This functions works in R6.0 but it can’t be used to create a progress bar in the status bar.
How can i implement a progress bar in the status bar with NEMProgress… functions as in the previous versions (R5.x)?
This functions works in R6.0 but it can’t be used to create a progress bar in the status bar.
Subject: Progress Bar with NEMProgress… functions
I know the NEMProgress bar is cooler than you can do with character graphics, but if you can use one created with character graphics, look here.
Subject: Progress Bar with NEMProgress… in-doc solution
A more elegant solution (which I unfortunately cannot use now, since I have an
OLE object which fills the entire pane):
BR>]- create a subform libProgressBarSubform, with a layout region, labelled
0% left and 100% right, a field for a progress bar Title, another for a
progress bar description, and a third for progress itself, all CFD.
BR>]- hide the layout using a CFD field called prgBarActive (0 or 1 value)
BR>]A script to show progress might look like the following:
dim w as new notesuiworkspace
dim u as notesuidocument
Const indicator = “+”
with u.document
.prgBarActive = 1
.prgBarTitle = “Processing Things To Do”
u.refreshhideformulas ’ shows the progress bar
’ … your loop here
forall entry in MyListOfThingsToDo
.prgBarDescription = ListTag(entry)
.prgBarIndicator = .prgBarIndicator(0)+indicator
end forall
.prgBarActive = 0
u.refreshhideformulas
end with
You can add all the fancy timing and other checking stuff contained in the
script Andre provided above.
This method keeps the progress bar within the document, doesn’t store any
additional info as overhead, and doesn’t clutter up your status bar.
I made this as a proof of concept yesterday, and have not tested what
happens with a CTRL-Break… you probably have to add .prgBarActive=0;
u.refreshhideformulas to the PostRecalc or something to clear it out (later).
BEST SOLUTION OF COURSE: a near-future release of Notes exposes the progress
bar! None of the solutions above can quite do the job correctly, and it leaves
our interface inadequate – as we cannot provide some essential features to our
users.
Subject: Progress Bar with NEMProgress… issues
NEMProgress is cooler, but I have been using it in a small-scale production app to test it out, and it has presented some problems you really can’t live with (hence the “not supported” rating, I would guess):
1 - users hitting the ctrl-break key to stop a long or unwanted script almost always freezes the screen.
2 - (less tragic) you cannot run the script debugger with the progress bar in place, otherwise similar unpleasantness occurs.
While the interface begins to look windowy instead of Notesy with NEMProgress, you simply cannot use it, unless in very controlled circumstances.
I looked at Andre’s fine code – definitely a few cuts above the average for notes scripts – and it should do nicely for most applications. I worried about the users not looking down at the status bar to see what’s going on, but then with long scripts (where the status bar is important) they’ve got nothing better to do – and that is the only action on their monitor, so probably it’s ok.
Thanks, Andre.
Subject: RE: Progress Bar with NEMProgress… issues
There’s probably not much that can be done about the debugging issues, but in the case of a Ctrl+Break I suspect the problem is failure to call a function to free the status bar. I don’t know the specific functions, but by putting your NEM calls in a class definition with Sub Delete, you may be able to get around that by insuring that every NEM call to display the status bar is matched by a call to release it.
I’m not saying you should do this – I’m more comfortable with the supported option myself – but if you must NEM, at least NEM responsibly.
Subject: RE: Progress Bar with NEMProgress… issues
No, I have (responsibly) tried that, of course. Unfortunately, CTRL-BREAK cuts the script down in its tracks, and the DELETE doesn’t fire. Nor does the Terminate event, or any other event I can find. I have been looking for a handle to the break event, so that I could unload the NEM, but haven’t located one.
I have already handled the debugging issue (sort of) by giving developers an INI variable that toggles the progress bar. And developers are responsible enough to deal with these issues anyway. The show-stopper is end users and ctrl-break.
By the way, the “supported” version doesn’t work well with OLE objects. Once the script grabs the object in edit mode (for some reason) the status bar is blanked each time something is read to or written to the object, so you get an instantaneous flash of the bar, which then immediately disappears. Hardly acceptable. I have tried hiding the (in this case Excel) object, etc etc, but to no avail.
Not sure which of these two issues is going to be resolvable – the one I can break will be the released code… if any!
Subject: Progress Bar with NEMProgress… functions
I believe those particular functions aren’t officially supported, so…
Stephen Lister