Consultor Eletrônico



Kbase P55470: 4GL/ABL: How to set the PROPATH environment variable for an AppServer session using 4GL/ABL?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   29/12/2008
Status: Verified

GOAL:

4GL/ABL: How to set the PROPATH environment variable for an AppServer session using 4GL/ABL?

GOAL:

How to get the PROPATH environment variable for an AppServer session using 4GL/ABL?

GOAL:

How to modify the PROPATH environment variable for an AppServer session at runtime?

GOAL:

How to programmatically change the PROPATH environment variable for an AppServer session at runtime?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.1x
OpenEdge 10.x

FIX:

The following samples, the client side 4GL procedure, client.p and the two AppServer side procedures, setPropath.p and getPropath.p, demonstrate how to programmatically set and get the PROPATH environment variable of an AppServer session at runtime using 4GL. These samples also demonstrate how to modify the PROPATH environment variable of an AppServer session:
/* ******************* clientProc.p ************************/

DEFINE VARIABLE hServer AS HANDLE NO-UNDO.
DEFINE VARIABLE lLogical AS LOGICAL NO-UNDO.
DEFINE VARIABLE cResult AS CHARACTER NO-UNDO.
/* Connect to the AppServer */
CREATE SERVER hServer.
ASSIGN
lLogical = hServer:CONNECT("-S 5162 -H HostName -N tcp -AppService ServiceName").
/* Test connection success */
IF lLogical THEN
MESSAGE "Connected to AppServer..."
VIEW-AS ALERT-BOX INFO BUTTONS OK.
ELSE
MESSAGE "can not connect to AppServer"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
/* Set a new Propath on the AppServer */
ASSIGN
cResult = "C:\temp," + PROPATH.
RUN setPropath.p ON hServer (INPUT cResult) NO-ERROR.
/* Get the new Propath on the AppServer */
RUN getPropath.p ON hServer (OUTPUT cResult) NO-ERROR.
MESSAGE "AppServer PROPATH:" "~n" cResult
VIEW-AS ALERT-BOX INFO BUTTONS OK.
/* ******************* setPropath.p ************************/
DEFINE INPUT PARAMETER ipc AS CHARACTER NO-UNDO.
ASSIGN PROPATH = ipc.


/* ******************* getPropath.p ************************/
DEFINE OUTPUT PARAMETER ipc AS CHARACTER NO-UNDO.
ASSIGN ipc = PROPATH.