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

Hello Joop!
Thursday October 02 1997 22:28, Joop Buker wrote to All:
 JB> To All,
 JB> Here I am again with a beginners problem with Clipper 5.2.
 JB> I want to use the WHEN prevalidation. I want that a get is only entered
 JB> when the the previous get was left with the key . I tried 
this
 JB> in the following way, but that does not work. What is the solution?
Well, I tried it too and it does function.
I suggest you this (I work with 5.01 so I made a little modification)
#include "inkey.ch"
setkey( K_CTRL_RET, { || CtrlEnter() } )
//->           in lieu of K_CTRL_ENTER
cA := space( 10 )
cB := space( 10 )
cC := space( 10 )
while lastkey() != K_ESC
   EDITB:=.f.
   @ 10, 10 say 'A' get cA
->   @ 12, 10 say 'B' get cB when editb
   @ 14, 10 say 'C' get cC
   read
enddo
return
procedure CtrlEnter()
   keyboard chr( K_ENTER )
//-> keyboard chr(K_CTRL_ENTER) deleted line
   editb:=.t.
-> previous line added
   return
I tested it and it work very well. Don't forget that when you do a setkey(), 
when you enter in the function, you must disabled it in order to avoid 
automatically calls of the procedure from the procedure. I think your prg was 
confused because when you issued the chr(K_CTRL_ENTER) the procedure 
CtrlEnter() was in a infinite loop calling itself until you press Alt-C
Hoping being of help,
Jean-Lievin
--- 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™.