Progress
Programming
Handbook
User-defined Functions
Progress 4GL user-defined functions let your application define a logical rule or transformation once, then apply the rule or transformation with absolute consistency an unlimited number of times. For example, if you are developing a weather application that converts temperatures between Celsius (C) and Fahrenheit (F), you can write two user-defined functions, one for converting from C to F and one for converting from F to C. Then, whenever your application must convert a temperature in either direction, you merely reference one of the user-defined functions.
The definition of a user-defined function can reside in the procedure that references it, in a procedure external to the procedure that references it, or in a procedure remote to the procedure that references it. In other words, a user-defined function can be defined locally, externally, or remotely.
User-defined functions follow the rules of scope and visibility that internal procedures follow. For more information, see the section "Shared and Local Context."
Some restrictions apply to user-defined functions:
The examples in this section use a user-defined function that accepts a number of type INTEGER, multiplies the number by two, and returns the result. The examples reside on-line in
%DLC%\src\prodoc\langref
on Windows and in$DLC/src/prodoc/langref
on UNIX.This section covers the following topics:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |