If you are converting a text-based Clipper application, a FoxPro application or just writing an application from scratch, use this forum for your eXpress++ questions.
STATIC FUNCTION XSample_3
/*
@ SAY..GETS (PIXEL BASED)
This sample demonstrates several @ DCSAY..GETs with automatic sizing
of the dialog window to the objects and an additional set of buttons
for OK and CANCEL. The window is MODAL. Coordinates are PIXEL-based.
*/
LOCAL GetList := {}, dDate := Date(), nNumber := 12345.67, ;
cString := 'This is a string', lLogical := .t., GetOptions
SET DATE FORMAT TO 'mm/dd/yyyy'
@ 10,1 DCSAY 'Enter a Date' GET dDate PICTURE '99/99/9999' ;
SAYRIGHT GETSIZE 100
@ 30,1 DCSAY 'Enter a Number' GET nNumber SAYRIGHT
@ 50,1 DCSAY 'Enter a String' GET cString SAYRIGHT
@ 70,1 DCSAY 'Enter Yes or No' GET lLogical PICTURE 'Y' SAYRIGHT
DCGETOPTIONS ;
WINDOWHEIGHT 300 ;
WINDOWWIDTH 400 ;
SAYWIDTH 120 ;
PIXEL ;
TITLE 'Data Entry' // Store options to GetOptions
DCREAD GUI ;
TITLE 'Pixel-Based GETs' ;
BUTTONS DCGUI_BUTTON_OK + DCGUI_BUTTON_CANCEL ;
MODAL ;
OPTIONS GetOptions
// evaluate here if cancel was pressed
// if cancel is pressed, say "Hello Cancel is pressed" in a dialog.
RETURN nil
*** END OF EXAMPLE ***
Is it possible to call a function when Cancel is pressed.
ABORTQUERY was designed to give the programmer the ability to control the exit process of a window.
This is why it requires a code block. Anything can be put into a code block. In the sample I showed you there was only a DCMSGBOX because that's what you said you wanted. You can call any functions that return any values except the last function (expression) must return a logical value. If a .T. is returned then exit will occur, otherwise it will not.
The eXpress train is coming - and it has more cars.