PreviousNext
Help > Développement > Fonctions W-Langage pour AS/400 > Fonctions Appel de Programmes/Procédure > ASAppelPgm >
 Exemple 2


Dans cet exemple, on appelle le programme RPCSAMPLE en utilisant une définition PCML dans le code :

 

 

sPCML est une chaîne

 

 

HOuvreConnexion(MaConnexionpower8)

 

sPCML = [

      <pcml version="4.0">

      <program name="RPCSAMPLE" path="/QSYS.lib/EASYCOMXMP.lib/RPCSAMPLE.pgm" >

      <data name="OP1" type="packed" length="5" precision="2" usage="input" />

      <data name="STR1" type="char" length="20" usage="input" />

      <data name="OP2" type="packed" length="5" precision="2" usage="inputoutput" />

      <data name="STR2" type="char" length="30" usage="inputoutput" />

      <data name="OP3" type="packed" length="10" precision="4" usage="output" />

      </program>

      </pcml>

]

 

 

STStrpcsample est Structure

      OP1 est réel

      STR1 est chaîne sur 20

      OP2 est réel

      STR2 est chaîne sur 30

      OP3 est réel

FIN

 

stRpcSample est STStrpcsample

stRpcSample.OP1 = 2

stRpcSample.STR1="aura"

stRpcSample.OP2 = 3

stRpcSample.STR2 = "test"

stRpcSample.OP3 = 4

 

 

SI PAS ASPgmCall(sPCML, "", MaConnexionpower8, stRpcSample) ALORS

      Info(ErreurInfo())

SINON

      Info("OP1="+ stRpcSample.OP1 + " - STR1=" + stRpcSample.STR1 + " - OP2=" + stRpcSample.OP2 + " - STR2=" + stRpcSample.STR2 + " - STR3=" + stRpcSample.OP3)     

FIN