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