PFCLKBREAK also a no-op?
Brian K. White
brian at aljex.com
Fri Feb 20 06:28:35 PST 2009
No matter what I set PFCLKBREAK to, unset, OLD, OFF,
in rclerk I can not avoid a break taking immediate effect.
I can only test for @SK eq "BRKY" after the event.
For example, the following code:
prc.input
---top---
Then: msgbox "@save\ninkey=\""& kp & "\"\n at sk=\"" & @sk & "\""
Then: end
@entsel° If:
Then: msgbox "@entsel\ninkey=\""& kp & "\"\n at sk=\"" & @sk & "\""
Then: end
@keyb ° If: ' test detecting break key instead of dying immediately
Then: show "Waiting ..."
Then: kp = ""
blp ° If: kp eq "" and @sk ne "BRKY"
Then: sleep "100" ; kp = inkey ; goto blp
Then: msgbox "@keyb\ninkey=\""& kp & "\"\n at sk=\"" & @sk & "\""
Then: end
---bottom---
I want to hit "b" to get into @keyb,
then hit Del or Ctrl-C during the inkey loop at blp,
and then detect that I pressed break while still in @keyb.
I should see this:
@keyb
inkey=""
@sk="BRKY"
Instead, all I ever see is:
@entsel
inkey=""
@sk="BRKY"
Meaning it broke out immediately and I only detected it back up in @entsel.
I discovered that calling out to a call table is a work-around.
if I replace the sleep "100" with a call "sleep" ,
and prc.sleep has only one line sleep "100" ,
Then when I press break, it breaks out of the call, dropping
back to @keyb where I can gracefully detect @SK eq "BRKY"
Even if that wasn't too ugly to bear, calling a whole other file
every 100ms? yuk, it doesn't matter because where I really want this
I'm already IN a call, and so I can't call anything else.
I'm trying to allow a user to abort out of a scan & upload operation
gracefully and naturally by hitting break. I don't know how long the
operation may take, and I can't allow the user to proceed until the
operation either completes or the user aborts it, so create a lock
file and just loop forever wating for a lockfile to disappear,
checking exists every 100ms, and if theres a problem the user can
just hit break any time. But if they do, I need to detect it and
clean some stuff up, not actually abort all the way out of the call
table instantly.
The only way I can see to do this now without PFCLKBREAK doing what
the manual claims, is do a "break off" just before I start looping
and then watch for the user to press X or F8 or anything BUT break,
because with break off, I can't detect the break keypress _at all_ .
I don't like the inconsistent user interface that would make though.
I want to be able to give the users simple rules that apply everywhere.
So ideally I want them to press break to back out of this operation
just like any other.
Or, I guess I could have this now by adding the code for
"detect break and clean up temp files" to all of the input tables where
this call table is called from, immediately after the calls.
It's quite inconvenient but possible, but, there is this perfect
sounding PFCLKBREAK in the manual that says I shouldn't have to do that.
--
Brian K. White brian at aljex.com http://profile.to/KEYofR
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!
More information about the Filepro-list
mailing list