|
¨ To get started with a PFC application:
- Access the Application painter.
- Define a library list that contains PFC PBLs:
PFCAPSRV.PBL PFCDWSRV.PBL PFCMAIN.PBL PFCWNSRV.PBL PFEAPSRV.PBL PFEDWSRV.PBL PFEMAIN.PBL PFEWNSRV.PBL
- From the Application painter, display the PowerScript painter and define a global variable, gnv_app, of type n_cst_appmanager.
n_cst_appmanager gnv_app
The variable name must be gnv_app PFC objects, functions, and events require that you define the application manager as gnv_app, with a data type of n_cst_appmanager (or an n_cst_appmanager descendant).
- Add PowerScript code to your application's Open event to create n_cst_appmanager and call the pfc_Open event:
gnv_app = CREATE n_cst_appmanager gnv_app.Event pfc_Open(commandline)
- Add PowerScript code to your application's Close event to call the pfc_Close event and destroy n_cst_appmanager:
gnv_app.Event pfc_Close( ) DESTROY n_cst_appmanager
- Close the Application painter and save the changes.
- Access the User Object painter and open n_cst_appmanager, found in PFEAPSRV.PBL.
- Call n_cst_appmanager functions in the Constructor event to initialize instance variables for version, company, and INI file.
- Call n_cst_appmanager functions in the pfc_Open event to enable the application services you want.
- Add code to the pfc_Open user event to open your application's initial window (typically the frame window), optionally including a call to the of_Splash function, which displays a splash screen.
- Save n_cst_appmanager.
Predefined libraries
To see a predefined PFC application running, use one of these applications:
Sample application. Open the PEAT.PBL application, found in pfc\DemoApp. This provides a small sample application.
Code examples. Open the EXAMPFC.PBL application, found in pfc\Examples. This provides examples of many PFC functions and services.
PFC quick-start libraries. Open the QCKSTART.PBL application, found in pfc\qckstart. The functionality provided by the PFC quick-start PBLs is the rough equivalent of what you get from the PowerBuilder GenApp application.
It's best if your application works with a copy of the PFC quick-start libraries. That way, you'll always have the original copy as a backup.
PFC Tutorial
The PFC User's Guide includes a tutorial that explains the basics of coding a PFC application.
|