Announcement

Collapse
No announcement yet.

My Message Pump broke (needs a new impellor?)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • My Message Pump broke (needs a new impellor?)

    Here is my window creatin:

    FUNCTION PBMAIN
    DIM FileDataStore(50)
    DIALOG NEW 0, " Convert TS Ascii Data ", 130, 10, 110, 35, 0 TO hDlg
    CONTROL ADD BUTTON, hDlg, 101, "Run", 10, 5, 40, 14, 1
    CONTROL ADD BUTTON, hDlg, 102, "Quit", 60, 5, 40, 14, 0
    CONTROL ADD LABEL, hDlg, 114, "Line Info", 2, 23, 109, 12, ' Info
    DIALOG SHOW MODAL hDlg CALL MainCB
    END FUNCTION
    '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤'
    Fiairly straightforeward. So I hit the run button and it starts bombing thru 300 lines of data in a file.

    Then i realize that I forgot something and i need to quit the app. So I pust the QUIT button and nothing happens. No messages are processed like button pushes.

    So I added a DIALOG DOEVENTS and that "fixed" the broen pump, but now it crawls thru the code. It takes about 10x longer.

    How do fix the pump without slowing the code pls

    Is there a hand pump for sneaky one shot btn push emegencys?

    ------------------
    Kind Regards
    Mike

  • #2
    Use the MOD operator to control the Doevents, something like:
    Code:
    IF I MOD 2 = 0 THEN DIALOG DOEVENT
    INCR I
    If code takes a while to perform, one must include some kind of
    DOEVENTS inside it, to allow other things to happen in Windows.
    So, you message pump isn't broken, it's only very busy and selfish..


    ------------------

    Comment

    Working...
    X