Try OpenEdge Now
skip to main content
Online Help
Introducing the ABL Editor : Tasks : Writing ABL code : Writing procedural code : Adding functions
 
Adding functions
The OpenEdge Editor provides a wizard that helps you add a new function to an ABL source file. To use this wizard:
1. Choose Source > Add Function. The Add Function dialog appears.
2. If the current file is an ABL procedure file, then go to step 3.
Otherwise, if the current file is an AppBuilder procedure (adm1 or adm2) file, do one of the following:
*Select the Function option to create a function.
*Select the Override option to have the Name field display a list of the user-defined functions that you can override.
Note: The Override option is disabled when there are no functions to override.
3. In the Name field, specify a function name.
Note: If you have selected the Override option, the Name field displays a list of user-defined functions that you can override. Select a function that you want to override.
4. Select a return type, and select whether the function is private. Also choose whether to include a CATCH block and/or a FINALLY block for structured error-handling.
5. Choose an insertion position. The Insertion position field gives you the following options:
*Alphabetical order - Insert a code prototype based on its name. Case is ignored.
This feature does not sort the procedures, functions, methods, or properties that already exist in the file. If they are already ordered alphabetically by name, insertion of new code will be done at the correct position in the list. Otherwise, insertion will be the first valid alphabetic position found during a top-to-bottom lookup.
*Cursor position - Insert code prototype at the current position of the cursor in the file.
*First/Last - Insert the code prototype as the first or last item
*After name - Insert the code prototype after the named procedure.
6. Click OK.
The OpenEdge Editor inserts a prototype for the function. You can fill in and modify the prototype as appropriate.