Progress
Programming
Handbook
Application Messages
Within an application you might want to pass a message from one procedure back to the procedure that called it. For example, if a subprocedure encounters an error, you might want to pass a message about the error back to the caller. You can pass such as message on the RETURN statement. For example,
p-retstr.p
tries to find a customer record in the database and returns either the customer name or a message indicating why the record is not available:
The calling procedure can read a returned message by using the RETURN–VALUE function. For example,
p-retval.p
runsp-retstr.p
and displays the returned value in a frame:
This procedure displays all customer numbers from the first to the current value of the next–cust–num sequence. For each number it displays either the customer name or a message indicating the status of that record.
NOTE: If you have a procedure which does not end with the RETURN statement, the value in RETURN–VALUE will be the value of the last executed RETURN statement. RETURN–VALUE is not cleared if there is no RETURN statement. If no value was reurned by the most recently executed RETURN statement, RETURN–VALUE returns an empty string (“”).For more information on the RETURN statement and the RETURN–VALUE function, see the Progress Language Reference .
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |