Function AppType() Foundation

Returns the operating mode that an application is running in.

Syntax
AppType() --> nAppType
Return

The return value of AppType() is a numeric code identifying the operating mode of an application.

Description

An Xbase++ application can be created to run in different operating modes, such as text mode or GUI application. The operating mode is determined by the linker when the EXE file is created. The function AppType() determines the current operating mode. Possible return values are defined as constants in the XBP.CH file and are listed in the following table:

Return values of AppType()
Constant Operation mode
APPTYPE_NOVIO *) Full screen text mode only
APPTYPE_VIO Text mode
APPTYPE_PM GUI mode
  1. only possible with OS/2

Examples
Determine operating mode of an Xbase++ application
// In the example, a simple dialog box is displayed. 
// Depending on the operating mode, the display occurs 
// using either the function MsgBox() or Alert(). 

#include "Xbp.ch" 

PROCEDURE Main 

   IF AppType() == APPTYPE_PM 
      MsgBox( "This is a GUI application" ) 
   ELSE 
      Alert( "This is a text mode application", {"Ok"} ) 
   ENDIF 

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.