Describe can describe the value of a property of an object in DW, although the function describe can obtain the object's Information
But the value of the expression cannot be read normally.
Evaluate if you want to obtain the value of an expression consisting of attributes and functions in the data window object, you must use the evaluate function in the describe function,
The displayed value of lookupdisplay in the data window control is different from the actual value of the field. The getitemx function can only read the actual value of such a field, not the value you see. How can I read the value that the user sees? You can use this function,
The lookupdisplay function cannot be called directly from powerscript. It can be used with the evaluate function in describe. Because
The lookupdisplay function cannot specify which row of data to operate on. Its Parameter has only one field name, so it must be in the evaluate letter.
Number. The syntax of this function is: The columnname parameter of lookupdisplay (columnname) is the name of the field, not a string. If a function execution error occurs, an empty string is returned.
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:
Determines whether sex in Row 3 is 1. If sex is 1, a male is returned; otherwise, a female is returned.
Dw_1.describe ("evaluate ('If (sex = 1, male, female) ', 3 )")
Syntax: evalute ('expression', rowno)
Expression is an attribute expression, and rowno is the row number to be described. This function is placed in the describe attribute list.
Example 3:
Dw_1.describe ("evaluate ('lookupdisplay (column) '," + String (row number) + ")")
In dw_1, there is an edit attribute page for the gxbm field: datawindow: d_dmzd_gxbm, display column: dmmc, data column: gxbm.
Display: displays the dmmc value instead of the gxbm value. However, when we use getitemstring (row, "gxbm"), we get the gxbm value instead
Dmmc value displayed. If you want to obtain the dmmc value, use lookupdisplay:
Ls_1 = dw_1.describe ("evaluate ('lookupdisplay (gxbm) '," + String (1) + ")")
Example 4:
Dw_1.describe ("datawindow. Table. Select ")
Obtain the original SQL statement of dw_1.
Dw_1.describe ("datawindow. Table. Procedure ")