DCSAY ... GET ... VALID ... POPUP ... question

This forum is for eXpress++ general support.
Post Reply
Message
Author
skiman
Posts: 1040
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

DCSAY ... GET ... VALID ... POPUP ... question

#1 Post by skiman »

Hi,

With the code below I supposed the VALID would be executed ONCE if you do the following:
1. Click on the popup button
2. Click on the second GET or press ENTER in the first GET.

I didn't expect that the VALID is executed at the moment the POPUP returns to the GET? With the popup you don't LEAVE the GET, unless you returned an array where the second element is another object that must get the focus.

Code: Select all

function validpopuptest()
**************************
Local getlist := {} , cTest := space(10) , cTest2 := space(10) , lOk

@ 1,1 DCSAY "Test Valid: " GET cTest  ;
    VALID {|oGet,o| (DCBDEBUG 'validated'),.T. } ;  
    POPUP {|o,oGet| (DCBDEBUG 'popup'),(cTest:="ABC123")} ;
    SAYRIGHT SAYSIZE 20 GETSIZE 20 
	 
@ 3,1 DCSAY "Second line: " GET cTest2  ;
    SAYRIGHT SAYSIZE 20 GETSIZE 20 	 
	 
dcread gui fit addbuttons to lOk
	
return nil
So when a popup is used, the VALID clause is always executed twice. When this valid is time-consuming, it can make a difference for the speed of an application.

Looks to me as this is not the behaviour you would expect?
Best regards,

Chris.
www.aboservice.be

Post Reply