Describe, evaluatate, lookupdisplay usage in Pb

Source: Internet
Author: User

 

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 ")

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.