Page 1 of 1

dcsay get dcread gui without buttons

Posted: Sun Nov 01, 2015 12:38 pm
by alepap
I need to get 2 gets without having to press a ok button.

this is my code

******************************************************************************
FUNCTION sGETLOGIN()
LOCAL GetList[0], GetOptions, cID := SPACE(30), cPASSWORD := SPACE(30), lStatus

@ 3,2 DCSAY 'Identification' GET cID GETSIZE 30

@ 4,2 DCSAY 'Password' GET cPASSWORD GETSIZE 30 ;
PASSWORD

DCGETOPTIONS ;
NOMINBUTTON ;
NOMAXBUTTON ;
ENTERTAB ;
SAYRIGHTBOTTOM ;
SAYWIDTH 120 ;
TABSTOP

DCREAD GUI ;
FIT ;
OPTIONS GetOptions ;
ADDBUTTONS ;
ENTEREXIT ; // is this the problem?
TITLE 'Login' ;
MODAL ;
TO lStatus

IF lStatus
// do stuff here
ELSE
// do stuff here
ENDIF

RETURN .T.
******************************************************************************


I need to get out of the GET loop.
For now, if I use the ADDBUTTONS, I can press OK to terminate the GET loop.

If I remove the ADDBUTTONS, I tried the ENTEREXIT but does not work.
How do I enter first GET, enter second GET and exit the GET loop without the OK button?

Thank you,

Alexandre Papillon

Re: dcsay get dcread gui without buttons

Posted: Sun Nov 01, 2015 2:23 pm
by rdonnay
Your problem is the ENTERTAB clause of DCGETOPTIONS.

This causes the ENTER key event to be processed as a TAB key event and therefore the ENTEREXIT does not work.

Remove ENTERTAB and it will work just fine.

Re: dcsay get dcread gui without buttons

Posted: Sun Nov 01, 2015 7:16 pm
by alepap
Works perfectly. Thank you.