Kbase P99887: How to pass variables from the Client to the Server in a Distributed Application?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  1/11/2005 |
|
Status: Unverified
GOAL:
How to pass variables from the Client to the Server in a Distributed Application?
FIX:
Here an example of how to pass variables from the Client Side to a procedure to execute on the Server Side.
/* Excerpt of the routine to include in the "client-side" procedure to check the debt and displays a message */
RUN checkdebt.p on hServer (INPUT wtotbought, INPUT wtotpaid, OUTPUT msg).
MESSAGE msg.
/* end excerpt */
/* checkdebt.p */
/* Procedure running on the AppServer side */
/* It evaluates the debt according to the business rule and it passes back a message to display */
DEFINE INPUT PARAMETER wtotbought AS INT.
DEFINE INPUT PARAMETER wtotpaid AS INT.
DEFINE OUTPUT PARAMETER msg AS CHARACTER FORMAT "X(70)".
DEFINE VARIABLE percdebt AS INTEGER.
percdebt = (wtotbought - wtotpaid) * 100 / wtotbought.
IF percdebt <= 0 THEN msg = "Paid in full".
ELSE DO:
IF percdebt < 10 THEN
msg = "Less than 10% of debt".
ELSE msg = "Warning, Total debt > 10%".
/* .../... */
END.
/* end checkdebt.p */