4D v14.3GET PROCESS VARIABLE |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
GET PROCESS VARIABLE
GET PROCESS VARIABLE
The GET PROCESS VARIABLE command reads the srcVar process variables (srvVar2, etc.) from the source process whose number is passed in process, and returns their current values in the dstVar variables ( dstVar2, etc.) of the current process. Each source variable can be a variable, an array or an array element. However, see the restrictions listed later in this section. In each couple of srcVar;dstVar variables, the two variables must be of compatible types, otherwise the values you obtain may be meaningless. The current process “peeks” the variables from the source process—the source process is not warned in any way that another process is reading the instance of its variables. 4D Server: Using 4D Client, you can read 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, you can 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 GET 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 clients machines do not automatically know the ID number of that process, any negative value can be passed in the process parameter. GET PROCESS VARIABLE does not accept local variables as source variables. On the other hand, the destination variables can be interprocess, process or local variables. You “receive” the values only into variables, not into fields. GET PROCESS VARIABLE accepts any type of source process or interprocess variable, except:
The source process must be a user process; it cannot be a kernel process. If the source process does not exist, this command has no effect. Note: In interpreted mode, if a source variable does not exist, the undefined value is returned. You can detect this by using the Type function to test the corresponding destination variable. This line of code reads the value of the text variable vtCurStatus from the process whose number is $vlProcess. It returns the value in the process variable vtInfo of the current process: GET PROCESS VARIABLE($vlProcess;vtCurStatus;vtInfo) This line of code does the same thing, but returns the value in the local variable $vtInfo for the method executing in the current process: GET PROCESS VARIABLE($vlProcess;vtCurStatus;$vtInfo) This line of code does the same thing, but returns the value in the variable vtCurStatus of the current process: GET PROCESS VARIABLE($vlProcess;vtCurStatus;vtCurStatus) Note: The first vtCurStatus designates the instance of the variable in the source process The second vtCurStatus designates the instance of the variable in the current process. This example sequentially reads the 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 process. This example does the same thing as the previous one, but reads the array as a whole, instead of reading the elements sequentially: GET PROCESS VARIABLE($vlProcess;at_IPCom_Array;$anArray) This example reads the source process instances of the variables v1,v2,v3 and returns their values in the instance of the same variables for the current process: GET PROCESS VARIABLE($vlProcess;v1;v1;v2;v2;v3;v3) See the example for the command DRAG AND DROP PROPERTIES. |
PROPERTIES
Product: 4D
HISTORY
Created: 4D v6 SEE ALSO
CALL PROCESS ARTICLE USAGE
4D Language Reference ( 4D v12.4) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||