Script Statement: Puts the name and content of a script variable to the input buffer
:PUT_READ_BUF[FER] Variable Name = Content
:PUT_PROMPT_BUF[FER] Variable Name = Content
Syntax |
Description/Format |
---|---|
Variable Name |
Name of the script variable (without &) |
Content |
Value that should be assigned to the script variable |
Use this script statement in combination with the function ACTIVATE_UC_OBJECT as shown below:
|
:PUT_READ_BUFFER stores the script variable in a separate storage area and assigns an internal ID to it. Call this statement for each value to be stored. It is then stored in the same memory area.
The parameter variable name is specified without the character "&" which is used with script variables.
Note that you cannot write complete script arrays to the input buffer.
When ACTIVATE_UC_OBJECT is called in the script, the memory area is considered complete. As described above, the activated object can now access the script variables of this memory area.
The statement :PUT_READ_BUFFER which is used after the function ACTIVATE_UC_OBJECT uses a different storage area and assigns a new ID.
The following applies for reading script variables from the input buffer:
This script element can also be used to set the PromptSet values for the object which has been activated with ACTIVATE_UC_OBJEC. In this case, the name of the ReadBuffer variable must comply with the name of a PromptSet variable of the started object.
Multiple use of Variable Names
It is also possible to call :PUT_READ_BUFFER several times with the same variable name. The value is not overwritten because the statement creates an individual entry for each call in the memory area. :READ always starts searching at the beginning of the memory area when it reads a script variable. The variable's value that occurs first is returned. Then, the entry is deleted. When the script variable is read the next time, the value of its next occurrence is returned. The huge advantage is that values can be set and read in a loop.
In this first example, the script variable "DATE1" is supplied with a value and moved into the input buffer. Then the job "EVALUATION" is activated.
:PUT_READ_BUFFER DATE1# = "01.01.2006"
:SET &ACTJOB# = ACTIVATE_UC_OBJECT(JOBS,
EVALUATION)
The job "EVALUATION" uses the entry in the input buffer.
:READ &DATE1#,,
:SET &RET# = VALID_DATE("DD.MM.YYYY:&DATE1#")
The second example writes a particular value of a script array to the input buffer. Note that you cannot write a complete array to the input buffer.
:DEFINE &ARRAY#,string,5
:SET &ARRAY#[1] = "test1"
:PUT_READ_BUFFER TEST# = &ARRAY#[1]
:SET &AKTJOB# = ACTIVATE_UC_OBJECT(PRINT)
The activated "PRINT" object reads the value from the input buffer and writes it to the activation log.
:READ &TEST#,,
:PRINT "&TEST#"
The third example writes multiple values to the prompt buffer for a prompt where the Multi select box is checked. In this case, the "VARA#" is the name of the variable selected as the Data reference for the PromptSet element.
:PUT_PROMPT_BUFFER "VARA#[]"="VALUE1"
:PUT_PROMPT_BUFFER "VARA#[]"="VALUE2"
See also:
Script element | Description |
---|---|
Queries the user in a dialog | |
ACTIVATE_UC_OBJECT | Activates an object |
Script Elements - Activate Objects
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by function