Documentation component by D.Glodt (c)2003 Appendix A: QProcess

QProcess Component

QProcess is a non visible multithreading component that executes a background thread in your SUB. You cannot have another 
CALLBACK or CODEPTR( SUB ...) command in your code, because  this object already has CODEPTR used. The command can only be used once for a SUB (see CODEPTR/ CALLBACK).

QProcess Properties





Priority LONG R/W 0
Process priority with following values:
ProcessLow=-2
ProcessBelowNormal=-1
ProcessNormal=0
ProcessHight=2
ProcessAboveNormal=1
ProcessTimeCritical=15
ProcessIdle=-15

QProcess Methods
Method Type Description Params





Open SUB execute process 0
Suspend SUB  Suspend the background multithread 0
Resume SUB Restart the background multithread after a Suspend 0
Close SUB Stop process 0

QProcess Events
Event Type Occurs when... Params





OnProcess Process execution 0

QProgress Example
 

$TYPECHECK ON
$INCLUDE "RAPIDQ.INC"
$include "Object\QProcess.inc"
'Subs internal 
declare sub rout1
DECLARE SUB OpenClick
DECLARE SUB SendClick
DECLARE SUB fin
'Variables globales 
dim num as long
dim process as QProcess
process.OnProcess=rout1 'process routine

CREATE Form AS QFORM
  Caption = "Test process"
  Width=200
  Height=200
  Center
  CREATE OpenButton AS QBUTTON
    Caption="&Open"
    Left=20
    Top=50
    height=20
    OnClick=OpenClick
  END CREATE
  CREATE butexit AS QBUTTON
    Caption="Close"
    Left=20
    Top=75
    height=20
    Enabled=0
    OnClick=fin
  END CREATE
  CREATE ED AS QEDIT
    left=10
    top=10
    width=100
  END CREATE
END CREATE

Form.ShowModal

SUB fin
  process.close
  OpenButton.enabled=1
end sub 

SUB OpenClick
  OpenButton.enabled=0
  butexit.enabled=1
  process.priority=ProcessNormal
  process.open
END SUB

Sub rout1 ' process routine
  while true
    sleep 0.1
    num++
    ed.text="Count"+str$(num)
  wend
end sub