( parameter [ , parameter ] ... )
|
{ 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 ]
}
|
BUFFER buffer-name FOR database-table-name [ PRESELECT ]
|
INPUT | OUTPUT
| INPUT-OUTPUT
Specifies the parameter mode, which determines the direction that data travels when the parameter is passed at run time. An INPUT parameter travels from the caller (source), which sets its value, to the called function or method (destination or receiver), which can use the value. An OUTPUT parameter travels from the called function or method (source), which sets its value, back to the caller (destination or receiver), which can use the value. An INPUT-OUTPUT parameter travels both ways, first from the caller, which sets its value; then to the called function or method, which can use and reset the value and pass it back to the caller, which can use the returned 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 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 24. (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 25. (For example, the AS data type, UNSIGNED-BYTE, indicates a .NET
System.Byte.)
AS [ CLASS
] { object-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).
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.
Defines the parameter as an array of data elements with a primitive type (specified using the AS
primitive-type-name option) or an object type (specified using the AS
object-type-name option). This option can specify an array parameter as either determinate (has a defined number of elements) or indeterminate (has an undefined number of elements). To define a determinate array parameter, specify the EXTENT option with the
constant argument. This optional argument is an integer value that represents the number of data elements in the array parameter. To define an indeterminate array parameter, specify the EXTENT option without the
constant argument.
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).
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).
Specifies whether or not to append the data from a source instance to the receiving instance of a passed temp-table or ProDataSet parameter. To append INPUT parameter data, specify the APPEND option for the parameter in the method or user-defined function definition. To append OUTPUT parameter data, specify the APPEND option for the parameter in the method or function call.
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.
BUFFER buffer-name FOR
database-table-name [ PRESELECT
]
Defines a buffer parameter, where buffer-name is the name you specify for the buffer and
database-table-name is the name of a database table to which the buffer is attached. Note that
database-table-name can also specify the name of a temp-table. However, if the temp-table name is identical to a database table name, all ABL references to the database table name must use fully-qualified
database-name.database-table-name syntax. A buffer parameter is always INPUT-OUTPUT.
|
When defining an overloaded method or constructor, the signature must be unique among all overloaded method or constructor definitions, respectively, with the same name. The signature consists of the name of the method or constructor, the number of parameters, and the type and mode of each of its parameters, in order from left to right. The signature of a method does not include the method return type or access mode.
|
|
TABLE and TABLE-HANDLE parameters count as different data types for overloading, as do DATASET and DATASET-HANDLE parameters. However, because the schema is not known at compile time, you can define only one overloaded method or constructor with a TABLE-HANDLE parameter corresponding to other method or constructor parameters that differ only as TABLE parameters. Similarly, you can define only one overloaded method or constructor with a DATASET-HANDLE parameter corresponding to other overloaded method or constructor parameters that differ only as DATASET parameters.
|