RCALL

PURPOSE: Transfers control to another program located on a remote computer. Values are passed to and returned by an argument list in the statement.
STATEMENT SYNTAX:
{stno} RCALL{(unit)} progname{,ERR=stno}{,arg list}

where:
progname = the name of an SM32 program on the remote computer.
arg list = a list of constants, variables, and expressions whose values are to be passed to the called program.
EXAMPLE:
0100 RCALL "SUBROUT01",A$,A1$,K(10),G
0325 RCALL A$,T$,MONEY(ALL),T,G$,G1$
NOTES: The action of RCALL is dependant on the value set by the RPM function (The Remote Procedure Call Mode for this Channel #). RPM Settings:
0 - generate an error #460 on all RCALL's
1 - procede as Documented here.
2 - execute the RCALL as if it were a CALL (locally).

See RUN for a description of how a program is loaded.

The unit is normally ommitted since the file type supporting RCALL is the PC2 driver which is on unit 0.
The argument list contains 2 types of arguments:
1. Call by Value/Result: Since all variable data is passed thru the PC2 driver any variable that does not require a Result should force Call by Value as shown below. Examples of call by Value/Result variables are as follows:
0100 RCALL "OVER",A
with ENTER N
A is copied into N then at exit N is copied back to A

0100 RCALL "OVER",A$
with ENTER N$
A$ is copied into N$ then at exit N$ is copied back to A$. Note that the template for templated strings is also copied in and back out.

0100 RCALL "OVER",A(ALL)
with ENTER N(ALL)
The array A is copied into the array N then at exit the array N is copied back to array A

2. Call by Value: When the ENTER statement is executed the value from the call statement is assigned to the variable in the ENTER statement. Examples of call by value are as follows:

0100 RCALL "OVER",5
0100 RCALL "OVER",A(5)
0100 RCALL "OVER",A*B
0100 RCALL "OVER",0+A (force call by value)
with ENTER N
N receives the value from the call no number is returned at EXIT time.

0100 RCALL "OVER","ABC"
0100 RCALL "OVER",A$+B$
0100 RCALL "OVER",A$(X,Y)
0100 RCALL "OVER",""+A$ (force call by value)
with ENTER N$
N$ receives the string from the CALL no string is return at EXIT time.

0100 RCALL "OVER",""+ A(ALL) (this forces call by value since A(ALL) is really a string) with ENTER N(ALL)
All of array A is copied into array N