Defines one or more run-time parameters for a user-defined function, a class method (including a constructor), or a class event defined with an ABL method signature. ABL implements both scalar and array parameters for user-defined functions and methods of a class as NO-UNDO variables.
Use the following syntax to define each parameter, which can be a primitive, array, class, interface, temp-table, ProDataSet, or buffer:
{ INPUT | OUTPUT | INPUT-OUTPUT } { parameter-name AS {primitive-type-name|[ CLASS ]object-type-name} | { LIKE field } [ EXTENT [ constant ] ] | TABLE temp-table-name [ APPEND ] [ BIND ] [ BY-VALUE ] | TABLE-HANDLE temp-table-handle [ APPEND ] [ BIND ] [ BY-VALUE ] | DATASET dataset-name [ APPEND ] [ BIND ] [ BY-VALUE ] | DATASET-HANDLE dataset-handle [ APPEND ] [ BIND ] [ BY-VALUE ] } |
CHARACTER | COM-HANDLE | DATE | DATETIME | DATETIME-TZ | DECIMAL | HANDLE | INT64 | INTEGER | LOGICAL | LONGCHAR | MEMPTR | RAW | RECID | ROWID | AS-data-type |
If you are defining a parameter for a user-defined function, a pure ABL class method (without reference to .NET), or a class event defined with an ABL method signature, AS-data-type does not specify a valid primitive type name.
If you are defining a parameter for a method that overrides a .NET super class method (abstract or otherwise) or implements a method defined in a .NET interface, primitive-type-name must specify the exact .NET data type of the corresponding parameter in the overridden or implemented method. For a .NET mapped data type that is a default match for a given ABL primitive type, you must use the default matching ABL data type, as shown in Table 4. (For example, INTEGER indicates a .NET System.Int32.) For a .NET mapped data type that is not a default match for one of the ABL primitive types, ABL provides a data type keyword (AS-data-type) that you must use to explicitly indicate the required .NET data type, as shown in Table 5. (For example, the AS data type, UNSIGNED-BYTE, indicates a .NET System.Byte.)
Also note that when overriding or implementing a .NET array parameter, you must specify the .NET array object type (for example, "System.Int32[]" or "System.Byte[]"); you cannot use an ABL array equivalent (for example, INTEGER EXTENT or UNSIGNED-BYTE EXTENT).
You cannot directly specify the type name of a .NET mapped object type (such as System.Int32). To define a parameter that matches a .NET mapped type, you must define it as the corresponding ABL primitive type (primitive-type-name).
If you are defining a parameter for a method that overrides a .NET super class method (abstract or otherwise) or implements a method defined in a .NET interface, object-type-name must specify the exact .NET object type of the corresponding parameter in the overridden or implemented method. However, for .NET inner (nested) type, note the difference in the ABL syntax, which replaces the corresponding period (.) in the .NET object type with a plus (+) (see the Type-name syntax reference entry).
Also note that when overriding or implementing a .NET array parameter, you must specify the .NET array object type (for example, "System.Drawing.Point[]"); you cannot use an ABL array equivalent (such as System.Drawing.Point EXTENT).
For a class or interface return value, the AVM passes an object reference associated with the class or interface, not a class instance itself. For more information on object references, see the Class-based object reference reference entry.
The parameter will take on the characteristics of field. These characteristics include data type, extent, label, column-label, format, decimals, view-as and case sensitivity. One exception is UNDO, since all method and function parameters are always NO-UNDO.
You can override the extent of field by supplying your own EXTENT phrase. You cannot override any other characteristics because the only variable qualifier available in the parameter definition syntax is EXTENT.
If field is a variable or temp-table field, then it must be known by the compiler before the user-defined function, a class method, or class event you are defining can be compiled.
If field is a database field, then the database must be connected at compile time, but need not be connected at run time. You may optionally qualify a database field name with its database and/or table name.
The EXTENT is part of the parameter data type. For more information, see the Type-name syntax reference entry.
An indeterminate array parameter can be in one of two states: fixed or unfixed, meaning it either has a fixed dimension or it does not. An indeterminate array parameter has an unfixed dimension when first defined. You can fix the dimension of an unfixed indeterminate array parameter by:
The AVM treats a fixed indeterminate array parameter as a determinate array parameter; that is, its size is fixed. The AVM determines the size of an unfixed indeterminate array parameter at run time.
If you are using the AS option without the EXTENT option, or you specify constant as 0, the parameter is not an array parameter.
You can pass a temp-table parameter to both local and remote user-defined functions, as well as to methods of a class. The AVM passes the parameter by value, by default. That is, the caller and the called routine each have their own instance of the temp-table. When you invoke the routine, the AVM deep-copies the parameter from one instance to the other. The table that is copied depends on whether the parameter is INPUT, OUTPUT, or INPUT-OUTPUT. When you pass a temp-table as an INPUT parameter, the AVM replaces the receiving instance with the source instance, by default. You can also append the source instance to the end of the receiving instance by specifying the APPEND option. For more information about the APPEND option, see the option description later in this reference entry.
When passing a temp-table parameter, you can override the default deep copy and pass the parameter by reference or by binding (that is, by passing the parameter using either the BY-REFERENCE or BIND option). Passing a temp-table parameter by reference or by binding allows the caller and the called routine to access the same object instance (instead of deep-copying the parameter).
For more information about passing a temp-table parameter by reference or by binding, see the Parameter passing syntax reference entry. For more information about temp-table parameters, see OpenEdge Getting Started: ABL Essentials.
You can pass a ProDataSet parameter to both local and remote user-defined functions, as well as to methods of a class. The AVM passes the parameter by value, by default. That is, the caller and the called routine each have their own instance of the ProDataSet. When you invoke the routine, the AVM deep-copies the parameter from one instance to the other. The table that is copied depends on whether the parameter is INPUT, OUTPUT, or INPUT-OUTPUT. When you pass a ProDataSet as an INPUT parameter, the AVM replaces the receiving instance with the source instance, by default. You can also append the source instance to the end of the receiving instance by specifying the APPEND option. For more information about the APPEND option, see the option description later in this reference entry.
When passing a ProDataSet parameter, you can override the default deep copy and pass the parameter by reference or by binding (that is, by passing the parameter using either the BY-REFERENCE or BIND option). Passing a ProDataSet parameter by reference or by binding allows the caller and the called routine to access the same object instance (instead of deep-copying the parameter).
For more information about passing a ProDataSet object parameter by reference or by binding, see the Parameter passing syntax reference entry. For more information about ProDataSet object parameters, see OpenEdge Development: ProDataSets.
When you define a reference-only object in the calling routine, and you want to bind that object definition to an object instance in the called routine, define the parameter by specifying the BIND option in an INPUT or INPUT-OUTPUT parameter definition. When you define a reference-only object in the called routine, and you want to bind that object definition to an object instance in the calling routine, define the parameter by specifying the BIND option in an OUTPUT parameter definition. In either case, the reference-only object definition remains bound to the object instance until the routine containing the reference-only object definition is deleted or terminates.
You can bind multiple reference-only object definitions to the same object instance. You can also bind a single reference-only object definition to the same object instance multiple times without generating an error. However, you cannot bind a single reference-only object definition to multiple object instances.
When passing one of these parameters to a remote user-defined function, the AVM ignores the BIND option and deep-copies the parameter based on the specified parameter mode.
For more information about passing these parameters by binding, see the Parameter passing syntax reference entry.
If you use the PRESELECT option and access the buffer parameter in a DO or REPEAT block, the AVM creates an internal list of the records selected. The PRESELECT option tells the AVM to apply that internal list to the buffer you define.
So, overloading allows you to define multiple methods or constructors for a class definition, where all methods or constructors that have the same name all have different signatures. The signature cannot vary only by access mode or return type. If methods within a class definition differ only by their access modes or return types, ABL raises a compilation error.