Reg : Parameter passing in progress

Posted by Admin on 04-Nov-2009 02:04

hi ,

          how could i pass a parameter from forms  and how to receive the params in procedures in OPENEDGE ARCHITECT  4GL ....Help me soon....

Rajkumar.S

All Replies

Posted by marko.rueterbories on 04-Nov-2009 02:22

Hi Rajuhari,

like Matthew Baker told you before you have a procedure lets say

test.p:

DEFINE INPUT PARAMETER cTest AS CHARACTER NO-UNDO.

MESSAGE cTest VIEW-AS ALERT-BOX.

Inside of your form you do call this procedure from within the click handler method of a button:

RUN test.p ("This is the Message :)").

You can also define OUTPUT or INPUT-OUTPUT parameters to be able to manipulate Data inside the procedure and give it back to the form.

Hope that helps.

Marko

Posted by aspotti on 04-Nov-2009 02:53

Hi Rajuhari,

   passing parameters to a procedure is quite easy.

There are three parameters type: Input, Output and Input-Output. Any kind of paramters can be passed to a called procedure, so you can pass fixed variables, temp-tables, handles, proDatasets and so forth.

Herein is a sample with a variable

ProcA.p

DEFINE VARIABLE cVarName AS CHAR NO-UNDO.

ASSIGN cVarName = "Hello World!".

RUN procB.p (INPUT cVarName) NO-ERROR.

ProcB.p

DEFINE INPUT PARAMETER ipcVarName AS CHAR NO-UNDO.

MESSAGE "Text: " ipcVarName VIEW-AS ALERT-BOX.

Herein a sample with an Handle

ProcA.p

DEFINE VARIABLE hVarName AS HANDLE NO-UNDO.

hVarName = BUFFER customer:HANDLE.

RUN procB.p (INPUT hVarName) NO-ERROR.

ProcB.p

DEFINE INPUT PARAMETER iphVarName AS HANDLE NO-UNDO.

MESSAGE "Text: " iphVarName:NAME VIEW-AS ALERT-BOX.

Hope this could help

NOTE: it does not matter if the caller is a class, a window or a procedure and on the same way if the callee is a class a windows or a procedure

This thread is closed