Describe, Evaluatate, LookUpdisplay, in PB

xiaoxiao2021-03-06  16

Describe, Evaluatate, LookUpdisplay, in PB

Describe can describe the value of an attribute of an object in DW, although the function Describe can get information about the object, but the value of the expression cannot be read normally, and this is often encountered. Evaluate if you want When obtaining the value of the expression, the function, the function, the like, the function Evaluate is used in the function Describe, and the value of the value displayed on the data window control is not the same, and the function GetItemx is used. You can only read the true value of such a field, not the value seen by the user. How can I read the value seen by the user? You can use this function, the lookupdisplay function cannot be called directly from PowerScript, and can be used in Describe and the evAlate function. Because the function lookupdisplay cannot specify which row data is operated, its parameters have only one field name, so it must be used with the Evaluate function. The syntax of this function is: lookupdisplay (color "parameter columnName is the name of the field, not a string. The function execution error returns an empty string.

Example 1:

LS_1 = dw_1.describe ("dw_1.cb_4.text") LS_2 = this.describe (dwo.name ".coltype") Syntax: Value = DataWindow.Describe (String LS)

Example 2:

Judging whether the SEX of the third line is 1, if it returns a man, otherwise return to the female dw_1.describe ("Evaluate ('if (SEX = 1, male, female)', 3)")

Syntax: Evalute ('Expression', ROWNO) where expression is attribute expression, ROWNO is the line number to be described. This function is placed in the list of DESCRIBE's properties.

Example 3: dw_1.describe ("Evaluate ('LookUpdisplay (Column)", " String (Row Number)") ")

In the DW_1, there is a GXBM field with a GXBM field below: DataWindow: D_DMZD_GXBM, DISPLAY Column: DMMC, Data Column: gxbm. When displayed: Not the value of GXBM, but the value of DMMC, but we use GetItemString (Row When "gxbm"), get the value of gxbm, not the DMMC value displayed, if we want to get the displayed DMMC value, then use LOOKUPDISPLAY: ls_1 = dw_1.describe ("Evaluate ('LookUpDisplay ', " String (1) ") ")")

转载请注明原文地址:https://www.9cbs.com/read-41509.html

New Post(0)