Simple Programs
Most DataFlex programs will conform to at least the following basic structure:
Use Windows.pkg
{use all other necessary packages}
{declare global variables}
{declare global functions & procedures}
{define a panel object}
Start_UI
In the above structure, the Use Windows.pkg instructs the compiler to include a library of basic definitions that are needed to write a simple Windows program. A DataFlex program will define at least one object. It is necessary to include the class definitions for each object's class. These definitions are stored in external package files. Refer to the section on Using Packages for more information.
The Start_UI statement is required to start the event-driven user interface engine. Without a Start_UI, the program will simply create all of the defined data structures and then exit.
An example of a simple DataFlex program that displays a single panel object is shown below:
Use Windows.pkg
Use DFPanel.pkg
Object oPanel is a Panel
Set Label to "DataFlex"
Set Size to 80 150
End_Object
Start_UI
Refer to Developing Database Applications for information on how to build large-scale database applications.