Getting evaluated text value for text objects

I'm attempting to get the visible text value out of a text
object in a report.  If I describe the .Text attribute, I
can get the text out, however, if the value is an expression
I get the unevaluated string.

I can describe the Evaluate function called with the .Text
attribute as the argument, and this will normally return the
evaluated text from the element.

The problem I have encountered is when you have, for
example, a field named "phone" and the text value of the
text element is also the word "phone".  Calling evaluate on
this will replace the word "phone" with the phone number on
that row when what you actually want is just the text string
"phone".

What I need is the ability to tell whether or not the text
value of an element needs to be evaluated.  Is there any way
to obtain this information?
0
mlcprospect
3/19/2010 9:00:17 AM
sybase.powerbuilder.datawindow 28057 articles. 5 followers. Follow

1 Replies
711 Views

Similar Articles

[PageSpeed] 2

When you use an expression for a property, what Desribe returns is in 
format:

"default_value<Tab>expression"

Note the double quotes which are returned in this scenario!

If the property is a simple value, Describe would return you just:

default_value

So you may check the result of the Describe function and call 
Describe(Evaluate just when the first and last characters are double quotes. 
In this case do not forget to pass just the expression part after the <Tab> 
character, not the entire result of the Describe function.

Regards,
Ivaylo

<mlcprospect@nospam.com> wrote in message 
news:4ba33d21.45cf.1681692777@sybase.com...
> I'm attempting to get the visible text value out of a text
> object in a report.  If I describe the .Text attribute, I
> can get the text out, however, if the value is an expression
> I get the unevaluated string.
>
> I can describe the Evaluate function called with the .Text
> attribute as the argument, and this will normally return the
> evaluated text from the element.
>
> The problem I have encountered is when you have, for
> example, a field named "phone" and the text value of the
> text element is also the word "phone".  Calling evaluate on
> this will replace the word "phone" with the phone number on
> that row when what you actually want is just the text string
> "phone".
>
> What I need is the ability to tell whether or not the text
> value of an element needs to be evaluated.  Is there any way
> to obtain this information? 


0
Ivaylo
3/19/2010 9:36:43 AM
Reply: