Command APPDISPLAY Foundation

Displays an Application Part and activates it.

Syntax
APPDISPLAY [ <oApp> ] [ MODELESS ] [ SAVE ]
Parameters
<oApp>
<oApp> is the name of a variable that references an Application Part (refer to the INTO option of APPBROWSE or APPEDIT). If <oApp> is not specified the variable appObject is used.
MODELESS
The option MODELESS activates an Application Part in modeless state.
SAVE
The result of the SAVE option is that an Application Part is only hidden, not destroyed, when the window is closed by a user. The Application Part remains to exist and can be redisplayed using APPDISPLAY (it is analogous to READ SAVE). This improves performance if an Application Part is displayed/hidden multiple times.
Description

The command APPDISPLAY displays an Application Part (APP) that is created by commands like APPEDIT or APPBROWSE. Those APPs which have an own dialog window are displayed in modal state by default.

APPs have an own dialog window when the PARENT option is not used when the APP is created.

Modal display means that the execution of a program is halted in the program line that issues the APPDISPLAY command. A program resumes when the APP is closed by a user.

The option MODELESS must be used to display an APP in modeless state. In this case the program is not halted but immediately continues in the line following the APPDISPLAY command. A program must include an event loop when APPs are displayed modeless (see function AppEvent()). Also, displaying multiple APPs at a time requires the MODELESS option.

Examples
APPBROWSE and APPEDIT accessing the same work area

// The example demonstrates how to create and display modeless 
// Application Parts. A browser and an edit dialog is created. 
// Both access the same database. If one APP navigates the 
// record pointer, the other one is automatically synchronized 
// and updated. 

#include "Appbrow.ch" 
#include "Appedit.ch" 
#include "Appevent.ch" 

PROCEDURE AppSys 
// Desktop remains application window 
RETURN 

PROCEDURE Main 
   LOCAL nEvent, mp1, mp2, obj 
   LOCAL oEdit, oBrowse 

   USE Customer                     // Open database 

   APPBROWSE INTO oBrowse ;         // Define browser 
      FIELDS Firstname, Lastname, Phone, Street, Zip, City ; 
       TITLE "Address List" ; 
    POSITION LEFT, CENTER ; 
        SIZE 40 PERCENT 

     APPEDIT INTO oEdit ;           // Define edit dialog 
       TITLE "Customer Addresses" ; // It contains all fields 
    POSITION RIGHT, CENTER ;        // of the work area 
        SIZE 40 PERCENT 

   APPDISPLAY oBrowse MODELESS      // Display Application Parts 
   APPDISPLAY oEdit   MODELESS      // modeless 

   DO WHILE nEvent <> xbeP_Close    // Process events 
      nEvent := AppEvent( @mp1, @mp2, @obj ) 
      obj:handleEvent( nEvent, mp1, mp2 ) 
   ENDDO 
RETURN 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.