Get lock up problem
Posted: Wed Sep 20, 2006 4:10 pm
Hi Everybody,
I have a strange problem and I can not figure out what is happening...
In my app I have a dialog that displays info that I read in from a serial port. At a set time (5 seconds after data collection starts) I pop up a window asking for some user input.
For some reason, if the user tries to click OK as soon as the window opens the program locks up and the window will not close.
Any Ideas? (code below)
Thanks,
Jeff
Function GetBORG(nRecordNum)
LOCAL nBorg1:=0, nBorg2:=0, oBORG, oSayBorg, cBorgTitle
if ! empty( oBtn1Stop )
oBtn1Stop:Disable()
endif
if nRun = 1
cBorgTitle := "Start Rest"
elseif nRun = 2
cBorgTitle := "DeSat-Room Air test"
elseif nRun = 3 .and. lFirstRun
cBorgTitle := "Start O2 Test"
lStartO2 := .t.
lFirstRun := .f.
else
cBorgTitle := "Same time as DeSat in Room Air"
endif
Define Window oBORG Title "Enter BORG ("+cBorgTitle+")" from 10,10 to 20,55 NOSYSMENU
@ 2,6.5 say oSayBorg PROMPT "Dyspnea " of oBorg COLOR RGB(0,0,0),RGB(255,255,255)
@ 3.5,5 Get oGet var nBORG1 of oBORG SIZE 40,20 PICTURE "99.9"
@ 5,7.5 BUTTON oBtnBorgOK PROMPT "OK" SIZE 100,20 of oBORG ACTION (UpdateBORG(nRecordNum, nBORG1),oBORG:End())
oBtnBorgOK:Disable()
oBORG:Center()
Activate window oBORG
SysWait(.01)
SetWindowPos(oBORG:hWnd, -1,0,0,0,0,3)
Return Nil
Function UpdateBORG(nRecordNum, mData1 )
Use OxData Shared NEW Alias "BORG"
dbgoto( nRecordNum )
do while ! rlock()
enddo
BORG->BaseDys := mData1
BORG->WalkMark := .t.
if nRun = 1
mSatRest := VAL(SubStr(BORG->Data,6,3))
mDysRest := mData1
elseif nRun = 2
mSatEndAir := VAL(SubStr(BORG->Data,6,3))
lManualDeSat:=.t.
mDysAir := mData1
Borg->TextMark := "*"
BORG->O2 := .t.
else //nRun=3
if lStartO2
mSatO2 := VAL(SubStr(BORG->Data,6,3))
mDysO2 := mData1
lStartO2 := .f.
BORG->Stopped := .t.
else
mFatRest:= mData1
endif
endif
use
if ! empty( oBtn1Stop )
oBtn1Stop:Enable()
endif
Return Nil
I have a strange problem and I can not figure out what is happening...
In my app I have a dialog that displays info that I read in from a serial port. At a set time (5 seconds after data collection starts) I pop up a window asking for some user input.
For some reason, if the user tries to click OK as soon as the window opens the program locks up and the window will not close.
Any Ideas? (code below)
Thanks,
Jeff
Function GetBORG(nRecordNum)
LOCAL nBorg1:=0, nBorg2:=0, oBORG, oSayBorg, cBorgTitle
if ! empty( oBtn1Stop )
oBtn1Stop:Disable()
endif
if nRun = 1
cBorgTitle := "Start Rest"
elseif nRun = 2
cBorgTitle := "DeSat-Room Air test"
elseif nRun = 3 .and. lFirstRun
cBorgTitle := "Start O2 Test"
lStartO2 := .t.
lFirstRun := .f.
else
cBorgTitle := "Same time as DeSat in Room Air"
endif
Define Window oBORG Title "Enter BORG ("+cBorgTitle+")" from 10,10 to 20,55 NOSYSMENU
@ 2,6.5 say oSayBorg PROMPT "Dyspnea " of oBorg COLOR RGB(0,0,0),RGB(255,255,255)
@ 3.5,5 Get oGet var nBORG1 of oBORG SIZE 40,20 PICTURE "99.9"
@ 5,7.5 BUTTON oBtnBorgOK PROMPT "OK" SIZE 100,20 of oBORG ACTION (UpdateBORG(nRecordNum, nBORG1),oBORG:End())
oBtnBorgOK:Disable()
oBORG:Center()
Activate window oBORG
SysWait(.01)
SetWindowPos(oBORG:hWnd, -1,0,0,0,0,3)
Return Nil
Function UpdateBORG(nRecordNum, mData1 )
Use OxData Shared NEW Alias "BORG"
dbgoto( nRecordNum )
do while ! rlock()
enddo
BORG->BaseDys := mData1
BORG->WalkMark := .t.
if nRun = 1
mSatRest := VAL(SubStr(BORG->Data,6,3))
mDysRest := mData1
elseif nRun = 2
mSatEndAir := VAL(SubStr(BORG->Data,6,3))
lManualDeSat:=.t.
mDysAir := mData1
Borg->TextMark := "*"
BORG->O2 := .t.
else //nRun=3
if lStartO2
mSatO2 := VAL(SubStr(BORG->Data,6,3))
mDysO2 := mData1
lStartO2 := .f.
BORG->Stopped := .t.
else
mFatRest:= mData1
endif
endif
use
if ! empty( oBtn1Stop )
oBtn1Stop:Enable()
endif
Return Nil