      SUBROUTINE RPCSUB.FILEIO(SVR,V1,V2,V3,V4,V5,V6,V7,R.RES)
*PIC-LAN
*
*ALL
*PC
*Y
*
*
*
*
* This is a general RPC subroutine
*
*
*
*
* (C) Copyright 2001 Modular Software Corporation.  All rights reserved.
*
* This is a subroutine "template" that is used to make calling remote
* subroutines easier.
*
* To use RPC calls, you need to copy this subroutine template to the
* local subroutine name, edit some information in this routine, and
* then compile and catalog it.
*
* You can then call this subroutine as if it were executing on the
* remote system.
*
*
* There are a number of RPC subroutine "templates" available.  These
* templates allow you to:
*
*    o Pass from 1 to 20 subroutine paramters.
*    o Include an optional parameter that tells your application code
*      if the RPC call fails.
*
*
      DIM P.ARRAY(20)
*
      EQUATE N.PARAMETERS     TO 7
*
*----------------------------------------------------------------------*
* You need to define the name of the RPC server (the other end
* of the connection) that is to be called.  Server names are defined
* locally in the RPC.CTRL,HOSTS file.
*
      SERVER.NAME       = SVR
*
*----------------------------------------------------------------------*
* Define the name of the called subroutine (at the other end).  This
* subroutine must be callable, without common, from the PICLAN-IP
* account and have an RPC host subroutine definition on the server
* system in the RPC.CTRL,SUBS file.
*
      SUB.NAME          = "RPCSVR.FILEIO"
*
* RPC subroutine can also be password protected so that only certain
* program can call specific subroutines.  If you have password
* protected the subroutine on the server, then you need to fill
* in the password here.
*
      SUB.PSWD          = ""
*
*----------------------------------------------------------------------*
* RPCs requre that the parameters for your subroutine be transferred
* across the internet (or your private network).  This transfer does
* take time.  In many cases, not all of the paramters need to be
* transferred in both directions.  This parameter allows you to
* control which paramters needs to be Input, Output, or Both.
*
* The following string has one letter per subroutine parameter that
* controls Input, Output, or Both.  To setup the parameter transfer
* behaviour, create a string below with one character per subroutine
* parameter that indicates:
*
*    I - Send this parameter to the server but do not have the server
*        send it back.
*    O - Send a null for this parameter to the server and then have
*        the server send the resulting parameter back.
*    B - Both send and receive this parameter bidirectionally.
*
      SUB.PARAMETERS    = "BBBBBBBBBBBBBBBBBBBB"
*
*----------------------------------------------------------------------*
* The RPC.CTRL,HOSTS file includes parameters to control retries,
* the maximum amount of data that will be transfers, timeoutvalues, etc.
* If you wish to overide any of these parameters on a subroutine-by-
* subroutine basis, you can enter this information here.
*
* If you wish to use the values in the RPC.CTRL,HOSTS file then leave
* these variables at 0.
*
* All times are in seconds
*
      XMIT.TIMEOUT  = 0
      XMIT.MAX.SIZE = 0
      RECV.TIMEOUT  = 0
      RECV.MAX.SIZE = 0
      MAX.RETRIES   = 0
*
      GOSUB 100 ;* Actually call the RPC
*
      IF R.RES <> '' THEN
*----------------------------------------------------------------------*
*        This code space is to be used for processing of RPC failure
*        situations.  The R.RES variable will be set to a descriptive
*        variable string if for some reason the RPC was not completed
*        successfully.
*
*        You should note that this only denotes an RPC call failure.
*        Your application code will probably have it's own error flags
*        contained within the parameter list.
*
*
*----------------------------------------------------------------------*
      END
*
      RETURN
*
*======================================================================*
*======================================================================*
* You should not need to modify any code below this point!
*======================================================================*
*======================================================================*
100   REM local call processing
*
      MAT P.ARRAY = ''
*
      ON N.PARAMETERS GOTO 201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220
*
220   P.ARRAY(20) = V20
219   P.ARRAY(19) = V19
218   P.ARRAY(18) = V18
217   P.ARRAY(17) = V17
216   P.ARRAY(16) = V16
215   P.ARRAY(15) = V15
214   P.ARRAY(14) = V14
213   P.ARRAY(13) = V13
212   P.ARRAY(12) = V12
211   P.ARRAY(11) = V11
210   P.ARRAY(10) = V10
209   P.ARRAY(9) = V9
208   P.ARRAY(8) = V8
207   P.ARRAY(7) = V7
206   P.ARRAY(6) = V6
205   P.ARRAY(5) = V5
204   P.ARRAY(4) = V4
203   P.ARRAY(3) = V3
202   P.ARRAY(2) = V2
201   P.ARRAY(1) = V1
*
      CTRL = ''
      CTRL<1>  = SERVER.NAME
      CTRL<2>  = ''               ; * Place holder for target account (not implemented)
      CTRL<3>  = SUB.NAME
      CTRL<4>  = SUB.PSWD
      CTRL<5>  = XMIT.TIMEOUT
      CTRL<6>  = XMIT.MAX.SIZE
      CTRL<7>  = RECV.TIMEOUT
      CTRL<8>  = RECV.MAX.SIZE
      CTRL<9>  = MAX.RETRIES
      CTRL<10> = N.PARAMETERS
      CTRL<11> = SUB.PARAMETERS
*
      CALL PLIP.RPC.CLIENT(CTRL,MAT P.ARRAY,R.RES)
*
      ON N.PARAMETERS GOTO 301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320
*
320   V20 = P.ARRAY(20)
319   V19 = P.ARRAY(19)
318   V18 = P.ARRAY(18)
317   V17 = P.ARRAY(17)
316   V16 = P.ARRAY(16)
315   V15 = P.ARRAY(15)
314   V14 = P.ARRAY(14)
313   V13 = P.ARRAY(13)
312   V12 = P.ARRAY(12)
311   V11 = P.ARRAY(11)
310   V10 = P.ARRAY(10)
309   V9 = P.ARRAY(9)
308   V8 = P.ARRAY(8)
307   V7 = P.ARRAY(7)
306   V6 = P.ARRAY(6)
305   V5 = P.ARRAY(5)
304   V4 = P.ARRAY(4)
303   V3 = P.ARRAY(3)
302   V2 = P.ARRAY(2)
301   V1 = P.ARRAY(1)
*
      RETURN
   END
