PreviousNext
Help > Development > W-Language Functions for AS/400 > Program and Procedure calls > ASProcedureCall > Examples
Examples

 

Example 1 :

 

We call the RPCSAMPLE program. Parameters passed to the program are mapped to a WinDev structure:

 

 STStrpcsample est Structure

       rOp1 est réel

       sStr1 est chaîne sur 20

       sOp2 est réel

       sStr2 est chaîne sur 30

       rOp3 est réel

 FIN

 stRpcSample est STStrpcsample

 

 

 stRpcSample:rOp1 = 2

 stRpcSample:sStr1 = "aura"

 stRpcSample:sOp2 = 3

 stRpcSample:sStr2 = "test"

 stRpcSample:rOp3 = 4

 

 HOuvreConnexion(MaConnexionpower8)

 

SI PAS ASAppelProcedure("*PGM/RPCSAMPLE", "", "",MaConnexionpower8, stRpcSample)   ALORS

       Info(ErreurInfo())

 SINON

Info("OP1="+ stRpcSample.rOp1 + " - STR1=" + stRpcSample.sStr1 + " - OP2="stRpcSample.sOp2 + " - STR2=" + stRpcSample.sStr2 + " – OP3=" + stRpcSample.rOp3)     

 FIN

 

 

 

Example 2 :

 

We call the RPCSAMPLE program. Parameters passed to the program are mapped to a WinDev structure. We use also a service program :

 

 

STStrpcsample est Structure

      rOp1 est réel

      sStr1 est chaîne sur 20

      sOp2 est réel

      sStr2 est chaîne sur 30

      rOp3 est réel

FIN

stRpcSample est STStrpcsample

 

 

stRpcSample:rOp1 = 2

stRpcSample:sStr1 = "aura"

stRpcSample:sOp2 = 3

stRpcSample:sStr2 = "test"

stRpcSample:rOp3 = 4

 

sSrvPgm est une chaîne

 

sSrvPgm = "EASYCOMXMP/XMPSRVPGM"

 

HOuvreConnexion(MaConnexionpower8)

 

SI PAS ASAppelProcedure("*PGM/RPCSAMPLE", sSrvPgm, "",MaConnexionpower8, stRpcSample) ALORS

      Info(ErreurInfo())

SINON

      Info("OP1="+ stRpcSample.rOp1 + " - STR1=" + stRpcSample.sStr1 + " - OP2=" + stRpcSample.sOp2 + " - STR2=" + stRpcSample.sStr2 + " - STR3=" + stRpcSample.rOp3)   

FIN