[BLACKBOX] Long running command and Dialog.ShowStatus

From: Zinn, Helmut <"Zinn,>
Date: Thu, 3 Dec 2009 10:00:00 +0100

----boundary-LibPST-iamunique-748537011_-_-
Content-type: text/plain

Dear Josef,

this kind of problem I have since I work with Blackbox. The status line also get froozen while nothing is done by the user. Sometimes it happens more often and sometimes less. It depends on the windows operating system and on the graphic card drivers used: (very seldom) 2000 < XP < Vista < Windows 7 (more frequently).

What I am missing is a Break call which can be used in the following way:

done := FALSE;
WHILE ~done & ~Break() DO
   ...do one step...
   IF ...last step... THEN done = TRUE END;
END;

The "PROCEDURE Break(): BOOLEAN;" should update the display including the status line, allow to run the actions (e.g. a displayed clock should not be frozen) and it should look about: "Does the user would like to stop this loop?" I mean: "Is the CTRL-C (break-key) pressed on the keyboard?"

Maybe one reader of this mailing list have already a solution.

Regards

Helmut Zinn

-----Ursprüngliche Nachricht-----
Von: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
Gesendet: Donnerstag, 3. Dezember 2009 07:19
An: BLACKBOX{([at]})nowhere.xy
Betreff: [BLACKBOX] Long running command and Dialog.ShowStatus

Hi Everybody!

I have a long running command (about 15 min) and in order
to show that it makes progress, I call Dialog.ShowStatus,
which displays a message in the status bar at the bottom of the
application window.

This works fine as long as there is no event being sent to the
application e.g. by clicking the mouse or pressing a key.
If such an event occurs, the status bar stops being updated
after about 5 seconds and the application appears to be
completely frozen until the command terminates.
This confuses the users and it confuses even me.

I observed in the Windows Task Manager that the application is getting
a 'not responding' state after 5 seconds and also the application window
title changes in order to indicate that it is not responding.
I guess that there is some connection between this state change
and the update behavior of the status bar.

Is there any solution to this problem?
Any kind of better progress bar?
Any way of telling windows that the app is still alive?
Any way of increasing the 5 sec timeout?
Any other idea?

Thanks

- Josef

P.S. A simple test program follows

MODULE TestLong;
IMPORT Dialog, Strings;
PROCEDURE Do*;
  VAR i, j: INTEGER; s: ARRAY 20 OF CHAR;
BEGIN
  FOR i := 0 TO 300 DO
    FOR j := 0 TO 10000000 DO
    END ;
    Strings.IntToString(i, s);
    Dialog.ShowStatus("msg " + s)
  END
END Do;
END TestLong.


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-748537011_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCBEZWFyIEpvc2VmLFxwYXINClxw
YXINCnRoaXMga2luZCBvZiBwcm9ibGVtIEkgaGF2ZSBzaW5jZSBJIHdvcmsgd2l0aCBCbGFja2Jv
eC4gVGhlIHN0YXR1cyBsaW5lIGFsc28gZ2V0IGZyb296ZW4gd2hpbGUgbm90aGluZyBpcyBkb25l
IGJ5IHRoZSB1c2VyLiBTb21ldGltZXMgaXQgaGFwcGVucyBtb3JlIG9mdGVuIGFuZCBzb21ldGlt
ZXMgbGVzcy4gSXQgZGVwZW5kcyBvbiB0aGUgd2luZG93cyBvcGVyYXRpbmcgc3lzdGVtIGFuZCBv
biB0aGUgZ3JhcGhpYyBjYXJkIGRyaXZlcnMgdXNlZDogKHZlcnkgc2VsZG9tKSAyMDAwIDwgWFAg
PCBWaXN0YSA8IFdpbmRvd3MgNyAobW9yZSBmcmVxdWVudGx5KS5ccG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gMCBUTyAxMDAwMDAwMCBET1xwYXINCiAgICBFTkQgO1xwYXINCiAg
ICBTdHJpbmdzLkludFRvU3RyaW5nKGksIHMpO1xwYXINCiAgICBEaWFsb2cuU2hvd1N0YXR1cygi
bXNnICIgKyBzKVxwYXINCiAgRU5EXHBhcg0KRU5EIERvO1xwYXINCkVORCBUZXN0TG9uZy5ccGFy
DQpccGFyDQpccGFyDQotLS0tXHBhcg0KVG8gdW5zdWJzY3JpYmUsIHNlbmQgYSBtZXNzYWdlIHdp
dGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIgdG8gTElTVFNFUlZATElTVFMuT0JFUk9OLkNIXHBh
cg0KXHBhcg0KXHBhcg0KLS0tLVxwYXINClRvIHVuc3Vic2NyaWJlLCBzZW5kIGEgbWVzc2FnZSB3
aXRoIGJvZHkgIlNJR05PRkYgQkxBQ0tCT1giIHRvIExJU1RTRVJWQExJU1RTLk9CRVJPTi5DSFxw
YXINfX0
----boundary-LibPST-iamunique-748537011_-_---
Received on Thu Dec 03 2009 - 10:00:00 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:40 UTC