1. Mark Jones
  2. PowerBuilder
  3. Thursday, 16 January 2020 19:00 PM UTC

It appears that if the tag property of a datawindow object contains a ? or tab character then when you retrieve the value of the tag using dwo.tag or describe() it embeds the tag in doublequotes.

e.g.

The tag on a datawindow object is set to xxx?xxx.   

In the clicked event

string ls_tag

ls_tag=dwo.tag

messagebox("tag",ls_tag)

This will display "xxx?xxx" with double quote characters as part of the string!

Whereas if the tag on the field is xxx-xxx then this will display xxx-xxx without the extra quotes.

I have identified ? and tab characters as causing this problem.  I am sure there are other characters.  Since the tag is a simple string property there is no reason for this behavior!   

I am going to write this up as a bug unless someone can give me a good reason for this being valid.

 

Mark Jones

Mark Jones Accepted Answer Pending Moderation
  1. Thursday, 16 January 2020 21:49 PM UTC
  2. PowerBuilder
  3. # 1

Thanks for your reply,  that was our thought also  -  i.e. it was related to their expression parsing and the fact they return ? for an empty/invalid expression.    I guess we will have to always strip quotes off from any a tag value that we retrieve.   If the tag is truly quoted it then looks like this "~"bla~"" so we can always safely remove outer quotes if they exist. 

Thanks,

Mark

Comment
  1. Michael Kramer
  2. Thursday, 16 January 2020 22:45 PM UTC
Sounds like a good approach.
  1. Helpful
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Thursday, 16 January 2020 21:38 PM UTC
  2. PowerBuilder
  3. # 2

I expect it stems from the way the DataWindow syntax is tokenized.

Result =  ?  without quotes indicates "no value detected, hence default value applies."

TAB character is separator when a property may contain an expression. Say you have Color defined as BLACK (value = 0) but also an expression making value red if it is negative. EXPRESSION = if( price < 0, 192, 0 ). That value + expression in DataWindow syntax in (e.g. Edit Source) is represented as:

column( . . . color="0~tif( price < 0, 192, 0 )" . . . )

If DW engine didn't quote such results you would have a hard time knowing what you received. Examples:

Returned by dwo.Tag Interpretation
?   <= No quotes Does Tag contain just question mark?
- or - is there no Tag value hence you must rely on default value?
~t   <= Tab character Does Tag contain the static value = TAB?
- or - Is Tag static value = empty string and the DW expression also = empty string?

That is my guess on why you see that behavior.
I still prefer the text presented same way either always with or always without quotes.
Although I accept that altering behavior if this is "legacy behavior" since early PB versions then Appeon can't strange functionality without breaking a lot of existing apps.

HTH /Michael

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.