4D v14.3SET PROCESS VARIABLE |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
SET PROCESS VARIABLE
SET PROCESS VARIABLE
The SET PROCESS VARIABLE command writes the dstVar process variables (dstVar2, etc.) of the destination process whose number is passed in process using the values passed in expr1 (expr2, etc.). Each destination variable can be a variable or an array element. However, see the restrictions listed later in this section. For each couple of dstVar;expr variables, the expression 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 expression. 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. 4D Server: Using 4D Client, you can write variables in a destination process executed on the server machine (stored procedure). To do so, put a minus sign before the process ID number in the process parameter. Tip: If you do not know the ID number of the server process, you can still use the interprocess variables of the server. To do so, use any negative value in process. In other words, it is not necessary to know the ID number of the process to be able to use the SET PROCESS VARIABLE command with the interprocess variables of the server. This is useful when a stored procedure is launched using the On Server Startup database method. As client machines do not automatically know the ID number of that process, any negative value can be passed in the process parameter. SET PROCESS VARIABLE does not accept local variables as destination variables. SET PROCESS VARIABLE accepts any type of destination process or interprocess variable, 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. This line of code sets (to the empty string) the text variable vtCurStatus of the process whose number is $vlProcess: SET PROCESS VARIABLE($vlProcess;vtCurStatus;"") This line of code sets the text variable vtCurStatus of the process whose number is $vlProcess to the value of the variable $vtInfo from the executing method in the current process: SET PROCESS VARIABLE($vlProcess;vtCurStatus;$vtInfo) This line of code sets the text variable vtCurStatus of the process whose number is $vlProcess to the value of the same variable in the current process: SET PROCESS VARIABLE($vlProcess;vtCurStatus;vtCurStatus) Note: The first vtCurStatus designates the instance of the variable in the destination process. The second vtCurStatus designates the instance of the variable in the current process. This example sequentially sets to uppercase all elements of a process array from the process indicated by $vlProcess: GET PROCESS VARIABLE($vlProcess;vl_IPCom_Array;$vlSize) Note: In this example, the process variable vl_IPCom_Array contains the size of the array at_IPCom_Array and must be maintained by the source/destination process. This example writes the destination process instance of the variables v1, v2 and v3 using the instance of the same variables from the current process: SET PROCESS VARIABLE($vlProcess;v1;v1;v2;v2;v3;v3) |
PROPERTIES
Product: 4D
HISTORY
Created: 4D v6 SEE ALSO
CALL PROCESS ARTICLE USAGE
4D Language Reference ( 4D v12.4) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||