4D v14.3VARIABLE TO VARIABLE |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
VARIABLE TO VARIABLE
|
VARIABLE TO VARIABLE ( process ; dstVar ; srcVar {; dstVar2 ; srcVar2 ; ... ; dstVarN ; srcVarN} ) | ||||||||
Parameter | Type | Description | ||||||
process | Longint |
![]() |
Destination process number | |||||
dstVar | Variable |
![]() |
Destination variable | |||||
srcVar | Variable |
![]() |
Source variable | |||||
The VARIABLE TO VARIABLE command writes the dstVar process variables (dstVar2, etc.) of the destination process whose number is passed in process using the values of the variables srcVar1 srcVar2, etc.
VARIABLE TO VARIABLE has the same action as SET PROCESS VARIABLE, with the following differences:
4D Server: “Intermachine” process communication, provided by the commands GET PROCESS VARIABLE, SET PROCESS VARIABLE and VARIABLE TO VARIABLE, is possible from client to server only. It is always a client process that reads or write the variables of a stored procedure.
For each couple of dstVar;expr variables, the source variable must be of a type compatible with the destination variable, otherwise you may end up with a meaningless value in the variable. In interpreted mode, if a destination variable does not exist, it is created and assigned with the type and value of the source variable.
The current process “pokes” the variables of the destination process—the destination process is not warned in any way that another process is writing the instance of its variables.
VARIABLE TO VARIABLE does not accept local variables as destination variables.
VARIABLE TO VARIABLE accepts any type of destination process or interprocess variables except:
The destination process must be a user process; it cannot be a kernel process. If the destination process does not exist, an error is generated. You can catch this error using an error-handling method installed with ON ERR CALL.
The following example reads a process array from the process indicated by $vlProcess, sequentially sets the elements to uppercase and then writes back the array as a whole:
GET PROCESS VARIABLE($vlProcess;at_IPCom_Array;$anArray)
For($vlElem;1;Size of array($anArray))
$anArray{$vlElem}:=Uppercase($anArray{$vlElem})
End for
VARIABLE TO VARIABLE($vlProcess;at_IPCom_Array;$anArray)
Product: 4D
Theme: Process (Communications)
Number:
635
Created: 4D v6.0.2
GET PROCESS VARIABLE
Processes
SET PROCESS VARIABLE
4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)