File Maintenance Objects (Legacy) |
Historical Reference |
The legacy version of the NOMADS File Maintenance Generator interface includes two Program Type options for creating file maintenance panels - Generic Object and Custom Object. For either option, the File Maintenance Generator will build a panel with no logic attached for the panel or the controls. The event logic for a file maintenance panel is encapsulated in the methods of the maintenance program.
The Generic Object uses two standard programs: *win/flmaint.pvc and *win/flmaintio.pvc. All file IO is handled by the flmaintio.pvc program, while flmaint.pvc handles all the panel and control events. The flmaint.pvc program inherits both the NOMADS object, *nomads.pvc and flmaintio.pvc.
If the Program Type is Custom Object, then a custom program will be generated. The same methods used by the generic object flmaint.pvc will be added to the custom program. The folder methods, such as DefaultFolderPreload( ), will be declared only if the maintenance panel is generated with the Folders option selected.
Flmaint Object
Below is a list of methods in flmaint.pvc.
Methods |
Description |
Button_Cancel( ) |
Check if current record has been changed and close panel. Return value is ignored. |
Button_Clear( ) |
Clear record inputs/fields. Return value is ignored. |
Button_Del( ) |
Delete current record. Return value is ignored. |
Button_First( ) |
Get first record on file. Return value is ignored. |
Button_Last( ) |
Get last record on file. Return value is ignored. |
Button_Next( ) |
Get next record on file. Return value is ignored. |
Button_Prior( ) |
Get prior record on file. Return value is ignored. |
Button_Write( ) |
Write current record. Return value is ignored. |
DefaultChange( ) |
(Internal Use Only) Read current record. This logic will only execute if the control name is part of the key definition. Return value is ignored. |
DefaultInitialize( ) |
(Internal Use Only) Setup key definition fields, required fields and numeric fields. Return value is ignored. |
DefaultOnFocus( ) |
(Internal Use Only) Check if current record has been changed and enable/disable field inputs. Return value is ignored. |
InitializeFolder_Tab_1( ) |
(Internal Use Only) Build tab direction and NEXT_FOLDER string. Sets up the hidden multi-line control Folder_Tab_1. Return value is ignored. |
InitializeFolder_Tab_2( ) |
(Internal Use Only) Build tab direction and NEXT_FOLDER string. Sets up the hidden multi-line control Folder_Tab_2. Return value is ignored. |
InitializeFolder_Tab2M( ) |
(Internal Use Only) Build tab direction and NEXT_FOLDER string. Sets up the hidden multi-line control Folder_Tab_2M. Return value is ignored. |
OnFocusFolder_Tab_1( ) |
(Internal Use Only) On focus logic for hidden multi-line control Folder_Tab_1. Return value is ignored. |
OnFocusFolder_Tab_2( ) |
(Internal Use Only) On focus logic for hidden multi-line control Folder_Tab_2. Return value is ignored. |
OnFocusFolder_Tab_2M( ) |
(Internal Use Only) On focus logic for hidden multi-line control Folder_Tab_2M. Return value is ignored. |
OnExit( ) |
(Internal Use Only) Panel header on exit logic. Reset message library, parameters and close file. Return value must be 1 in order to allow the panel to terminate. |
PostLoad( ) |
(Internal Use Only) Build tables from embedded file info, enable/disable input fields, validate ARG_1$ and load a default record. Return value is ignored. |
DefaultFolderPostLoad( ) |
(Internal Use Only) Enable/disable groups and assign NEXT_ID depending on the tab direction variable Tab_Flg$. Return value is ignored. |
PreLoad( ) |
(Internal Use Only) Activate message library, open file, initialize variables. Return value is ignored. |
DefaultFolderPreLoad( ) |
(Internal Use Only) Build first tab and last tab string (used to control tab direction). Return value is ignored. |
Flmaintio Object
Below is a list of methods in flmaintio.pvc.
Methods |
Description |
Delete( ) |
(Internal Use Only) Delete current record. Returns 1 if successful, 0 if unsuccessful. |
Extract(_ReviewRec) |
(Internal Use Only) Lock record. |
KeyAfterNext( ) |
(Internal Use Only) Return key after next record. Returns 1 if successful, 0 if unsuccessful. |
OpenFile(_File_Name$) |
(Internal Use Only) Open file. |
ReadByKey(Keyno,Seg1$, |
(Internal Use Only) Read file using key number and key segments. |
ReadFirst( ) |
(Internal Use Only) Return first record using same key. Returns 1 if successful, 0 if unsuccessful. |
ReadLast( ) |
(Internal Use Only) Return last record using same key. Returns 1 if successful, 0 if unsuccessful. |
ReadNext( ) |
(Internal Use Only) Return next record using same key. Returns 1 if successful, 0 if unsuccessful. |
ReadNext(N$) |
(Internal Use Only) Return next record on file using an alternate key name or key number. |
ReadPrevious( ) |
(Internal Use Only) Return prior record using same key. Returns 1 if successful, 0 if unsuccessful. |
Update(_KeyType) |
(Internal Use Only) Update current record. |
A file maintenance panel is invoked as follows:
O=new("<.pvc program>","<panel name>","<library name>")
O'Process(arg_1$,arg_2$.....arg_20$)
In the above syntax, the arg_1$ through arg_20$ are optional.
Example:
The following example uses the generic object:
Cust_Id $="0001"
O=new("*win/flmaint","Customer","Mylib.en")
O'Process(Cust_Id$)
Data for customer 0001 will automatically be loaded after the panel is displayed.
The program created for a Custom object is designed to allow customization.
You can also create customized code for a Generic object if you wish. Save *win/flmaint.pvc under a new name and enter this name in the Maintenance Program input field. The program name must contain a .pvc extension.
The File Maintenance Generator includes two Button Location options for the browse/edit buttons on the panel - Bottom (default) or Side. The browse and edit buttons for the objects can be found in the library *win/scrnlib.en. The flmaintobj panel contains a horizontal button set and the flmaintobj.v panel contains buttons that appear vertically on the side of the generated panel.
To customize buttons on file maintenance panels, copy the flmaintobj panels to an alternate library and load the global variable %Flmaint_Lib$ with the alternate library name. NOMADS will then use these custom panels when generating a new file maintenance panel.