[PB] Describe, Evaluatate, and LookUpDisplay in PB

Source: Internet
Author: User

Describe, Evaluatate, and LookUpDisplay in PB (powerbuilder)

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 in a data window object consisting of attributes and functions, you must Describe the function.
Use the Evaluate 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 be used to read
Take the real value of this field, rather than 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
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) + ")")

Describe, Evaluatate, and LookUpDisplay in PB (powerbuilder)

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 in a data window object consisting of attributes and functions, you must Describe the function.
Use the Evaluate 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 be used to read
Take the real value of this field, rather than 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
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) + ")")

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.