TIP: Click on subject to list as thread! ANSI
echo: clipper
to: JOOP BUKER
from: JEAN-LIEVIN POELMAN
date: 1997-10-07 17:29:00
subject: WHEN - validation in GET`S

Hello Joop!
Answering a msg of , from Joop Buker to All:
Well I had a little time now and I rewrote your function so it functions with 
your original code slightly modified :
->
// remember I had to modify K_CTRL_ENTER in K_CTRL_RET
->
#include "inkey.ch"
setkey( K_CTRL_RET, { || CtrlEnter() } )
cA := space( 10 )
cB := space( 10 )
cC := space( 10 )
while lastkey() != K_ESC
   @ 10, 10 say 'A' get cA
   @ 12, 10 say 'B' get cB when nextkey() ==  K_CTRL_RET
->
/* use nextkey in lieu of lastkey(), lastkey doesn't function in this case
because lastkey sees only the K_ENTER and *** NOT *** K_CTRL_RET that is 
till
in the keyboard buffer */
   setkey( K_CTRL_RET, { || CtrlEnter() } )
->
/* this line above is added in order to reassign K_CTRL_RET that's disabled 
in the  procedure CtrlEnter() */
->
   @ 14, 10 say 'C' get cC
   read
enddo
return
func CtrlEnter()
   setkey( K_CTRL_RET, { || NIL } )
->
/* line added because if you doesn't deactivate the key, the procedure will 
e
in a infinite loop because you place the key that calls it in the buffer of 
the
keyboard */
->
keyboard chr( K_ENTER )+chr( K_CTRL_RET )
return
Hoping being of help,
Jean-Lievin
P.S. I suggest you when you have so 'strange' problems to compile you prg 
with the /b option and to use the debugger to 'see' your application living.
--- GoldED 2.41+
---------------
* Origin: Visit my homepage at http://ebs.be/jlp (2:291/742.1)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.