Re: [BLACKBOX] Long running command and Dialog.ShowStatus

From: [at]} <Georgy>
Date: Thu, 3 Dec 2009 21:05:56 +0100

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

You can also use background processing service using Services.Action:

MODULE TestLong;
        IMPORT Dialog, Services, Strings;
        TYPE LongFunc = POINTER TO RECORD (Services.Action)
                        i: INTEGER;
                END;
        VAR func: LongFunc;
        PROCEDURE (func: LongFunc) Do;
                VAR j: INTEGER; s: ARRAY 20 OF CHAR;
        BEGIN
                INC(func.i);
                FOR j := 0 TO 10000000 DO
                END;
                Strings.IntToString(func.i, s);
                Dialog.ShowStatus("msg " + s);
                IF func.i < 300 THEN
                        Services.DoLater(func, Services.now)
                ELSE
                        func := NIL;
                END;
        END Do;
        
        PROCEDURE Interrupt*;
                VAR res: INTEGER;
        BEGIN
                Services.RemoveAction(func);
                Dialog.GetOK("interrupted", "", "", "", {Dialog.ok}, res);
        END Interrupt;
        
        PROCEDURE DoLong*;
        BEGIN
                NEW(func);
                Services.DoLater(func, Services.now);
        END DoLong;
END TestLong.

^QTestLong.DoLong
^QTestLong.Interrupt

Chris, that's probably what you were suggesting?
This calculation takes more time however, as only 50% CPU is used by BlackBox.

Regards,
Georgy


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-488786972_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxnc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
----boundary-LibPST-iamunique-488786972_-_---
Received on Thu Dec 03 2009 - 21:05:56 UTC

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