Modifying Computed field Expression

Hello,

We have a software package that we use in our business, where we have some 
control over customizations to the program.  We don't have access to window 
objects, but we have access to certain datawindows and global functions.

One global function runs when a window refreshes.  The function contains a 
choose case statement to determine which window is opening.  It then runs 
the script for that window.

I have a computed field on a datawindow that just has an Expression of 0. I 
want to be able to have the Expression for the computed field get modified 
through this function to 0 + ll_link_to_prof where the value of 
ll_link_to_prof is obtained through an sqlca select in the function.

I've tried using:

ldw.object.link_to_prof.Expression = ll_link_to_prof

In the function after the sql select.  That complies fine, but when I run 
the program it says that it cannot find the external object property 
Expression for link_to_prof.

Is there a way to have a global function set the Expression on a computed 
field?

Thanks for any help,

Jim Dunn
0
Jim_Dunn
2/27/2003 8:19:13 PM
sybase.powerbuilder.general 62418 articles. 14 followers. Follow

3 Replies
375 Views

Similar Articles

[PageSpeed] 19

Addition:

The software currently uses PB 6.5.  We are also in the process of 
migrating to the next version which uses PB8.  If there is a difference in 
code, please let me know.

Thanks,
Jim
0
Jim_Dunn
2/27/2003 8:22:28 PM
From the help:

dw_1.Object.comp_1.Expression = "avg(salary for all)"

The expression is a STRING not a long, and "comp_1" is the name of the column
in
the DW.  If you don't have that exact name, you are S-O-L.

If you are reverse hacking a commercial application, try the DW Describe
function and get the full syntax of the DW from the global function, and then
pull the names and so on from that!!!  If the Global function does the OPEN
call
for the window itself, you may be able to deduce the name of the DW inside the
window (dw_1, dw_2, and so on), reference it as an instance variable, and open
the
code up like a hacksaw.  ;-)

PB does late binding on OLE objects, which means it doesn't know if anything
you
code is going to work until the very moment you execute the line of code, BTW.
So
dw_1.object.yankeedoodledandy will generally always compile!

Jim_Dunn wrote:

> Hello,
>
> We have a software package that we use in our business, where we have some
> control over customizations to the program.  We don't have access to window
> objects, but we have access to certain datawindows and global functions.
>
> One global function runs when a window refreshes.  The function contains a
> choose case statement to determine which window is opening.  It then runs
> the script for that window.
>
> I have a computed field on a datawindow that just has an Expression of 0. I
> want to be able to have the Expression for the computed field get modified
> through this function to 0 + ll_link_to_prof where the value of
> ll_link_to_prof is obtained through an sqlca select in the function.
>
> I've tried using:
>
> ldw.object.link_to_prof.Expression = ll_link_to_prof
>
> In the function after the sql select.  That complies fine, but when I run
> the program it says that it cannot find the external object property
> Expression for link_to_prof.
>
> Is there a way to have a global function set the Expression on a computed
> field?
>
> Thanks for any help,
>
> Jim Dunn

0
woz
2/27/2003 8:42:13 PM
You might want to do a describe("ll_link_to_prof.type") and evaluate the
result.  That will at least tell you if the name is valid and the type of
the object.

<Jim_Dunn> wrote in message
news:1229811BA7148CC7006F9F9385256CDA.006F9FA385256CDA@webforums...
> Hello,
>
> We have a software package that we use in our business, where we have some
> control over customizations to the program.  We don't have access to
window
> objects, but we have access to certain datawindows and global functions.
>
> One global function runs when a window refreshes.  The function contains a
> choose case statement to determine which window is opening.  It then runs
> the script for that window.
>
> I have a computed field on a datawindow that just has an Expression of 0.
I
> want to be able to have the Expression for the computed field get modified
> through this function to 0 + ll_link_to_prof where the value of
> ll_link_to_prof is obtained through an sqlca select in the function.
>
> I've tried using:
>
> ldw.object.link_to_prof.Expression = ll_link_to_prof
>
> In the function after the sql select.  That complies fine, but when I run
> the program it says that it cannot find the external object property
> Expression for link_to_prof.
>
> Is there a way to have a global function set the Expression on a computed
> field?
>
> Thanks for any help,
>
> Jim Dunn


0
Scott
2/27/2003 8:46:04 PM
Reply:

Similar Artilces:

modify expressions in computed fields ?
Can i modify expressions in computed fields depends on the value in a column like other properties like color (exam: text.Color='0~t If (formel_id =1 ,255,0)' )?? thats my test_modstring: c_test.Expression='0~tIf(formel_id =1 ,1+1,0)' i have only Syntax error at the last column. Thank you very much! Sure you can. Off hand your syntax looks ok. Replace "forme1_id" with a constant and see if it accepts the syntax: '0~tIf(1=1 ,1+1,0)' First get it working in the DW painter. Then copy that syntax out and use it in your modify. Regards, John ...

How to Modify computed field expression on Runtime?
Hello, I've a computed field with the Expression='No. '+String(getrow()). My question is with dw1.Modify(compute1 + ".Expression='No. '+String(getrow())") how can we put the quotes in the correct syntax. I always get an syntax error. Thanks, Miguel Have you tried: <DW Control Name>.Modify("<ComputedFieldname>.Expression='<expression>'") Maybe i didn't explained myself. The problem was the quotes when you want to do something like this: dw1.Modify("compute_01.Expression='~~'Register ~~&...

Modify Expression Editor
How about improving on the Modify Expression Editor a bit? We have some quite complicated expressions, and the tiny little MLE control that PB uses to allow us to edit expression is very clumsy (and yes, I do realize about the elipse to bring up the modal Modify Expression window - which contains an only slight less tiny MLE for editing the Expression). Not to mention that embedded Returns in the expression can cause the computed field to behave funny. How about a real editor, complete with color markups, support for indentation and carrage returns, AutoScript even! Oooh,...

Modify () to Change String Expression For computed Fields.
I am trying to change the expression for a computed field using Modify (). It works fine if I change it to a numeric expression but if I change it to String expression, it fails. Probably the syntax I am using to define the Modify string is wrong. String ls_Modify Integer li_Number ls_Modify = "cf_test.Expression = 'A" + String (li_Number) + "'" dw_1.Modify (ls_Modify) This results in an error. Remember that in ls_Modify = "cf_test.Expression = 'A" + String (li_Number) + "'&qu...

Describe/Modify Height Expression of Computed Field
How can I modify the height expression of a computed field on a grid datawindow (and then set it back) at runtime? The height is set to the height of all the columns on the grid (64), with rowheight() as the expression. When the datawindow is saved in HTMLTable format (as part of our routine to open the datawindow in Excel), this height expression results in a blank row between datawindow rows. Using Describe gets only the height value, not the expression. Is there a way to get the height (including the expression), remove the expression (then save in HTMLTable format), then r...

computed field of a computed field
Hello, I made nice datawindow with some aggregate functions to calculate a certain value at a group level. Now I want a grand total which gives me the sum of these values. Unfortunately this does not seem to be possible. So, when I have a computed field which is round (sum(file_field),0) located in the trailer band, I need a grand total of this field in the summary band. Does anyone know how to solve this ? Philip. Philip@acom.be (Belgium) Philip, in the group , you must have created a computed field having expression sum ( file_field ) for group 1 In the summery, y...

Modify Computed Field
hello, i would like to modify a computed field in a datawindow who is in the footer band. When i try : dw_trombinoscope.object.t_droite.Expression = "Page : " + string(il_page) I've the message : Error Accesing external object property expression at line 61 .... Why ?? Thanks ed That code looks OK to me. Are you sure it is a computed field and not a static text? t_ is usually the naming convention for a static text, which does not have an Expression property. <ed> wrote in message news:41fab6db.ce1.1681692777@sybase.com... > hello, > >...

Computed field expressions
Hi all, I have a problem with computed expressions. I am replacing occurence of a particular string in a computed field with another string( say from 'mm/dd/yy ' to 'dd/mm/yy') using powerscript and when I try to modify the expression it works in some cases and fails in other cases. For ex ls_syntax = ls_computename + ".Expression = " + "'"+ ls_expression + "'" this.modify(ls_syntax) In the above I get a Modify Syntax error in some cases. Therefore, I need a universal syntax that would work under all cases. Does a...

Modify compute expression
Hi there, i have a problem regarding a computed field that has to reference a field dynamically at runtime. This computed field also has a group on it which forces a pagebreak. Now the problem is that i set the value on the computed field to 0 in the painter, so that no pagebreak occurs. When i wan't to have the pagebreak i try to modify the compute expression field, but nothing happens. The way i do it is as follows: dw_okorapport.Modify("sideskift.Expression=' sortniveau '") or dw_okorapport.Object.sideskift.Expression = " sortniveau " ...

Computed field expression: AND or OR
Hi all, Just had a strange problem. In a computed field expression I placed following statement: (Value of prc_discount = 0 ) - IF( NOT IsNull( prc_discount ) AND prc_discount <> 0, 'Show text', '' ) --> Result = 'Show text' Now by changing the expression to: - IF( IsNull( prc_discount ) OR prc_discount = 0, '', 'Show text' ) --> Result = '' Can someone explain this behaviour, because I'm totally lost. (PB 8.0.1 Build 9056 on a W2K workstation) TIA, PascalB Hi Pascal, just a shot in the dark: ...

computed field expression
I have this statement but it is not producing the desired results. I have 2 computed fields that are supposed to get the total amount for cash and the total for credit. compute_1: If( payment_payment_form <> 'cash', sum( payment_amount for all),0) compute_2: If ( payment_payment_form ='cash, sum( payment_amount for all),0) Obviously this aboue just produces the total for both cash and credit. I can't get the syntax right but I need something like; If ( payment_payment_form ='cash, sum( payment_amount for all) where payment_form = cash,0) Any ideas?...

Computed Field not computing
I have a series of computed fields that calculate percentages and then a series that total those percentages. When I add the third total percentage field (out of four total) to my group trailer, all my total percentage fields sum to 0 when they should all sum to 100. If I move the third computed field into another band then they all sum to 100 and when I put it back they all still compute to 100. Why would this happen? I know computed fields constantly re-compute, but these are not initially computing correctly based on the number of computed fields present in my group trailer band...

Computing Computed Field
I Have a computed field in tailor band of a group. I tried to sum that computed field in summary band using another computed expression ..It is displaying 0 instead of sum I appreciated any help Thanks Sue IF you use the format sum(x for group 1) in Tailor group then use sum(x for all) in summary. Stephan Donati Fortisoft Corporation "Sue Sambireddy" <SSambireddy@bankofny.com> wrote in message news:3AE83A22.AF41D7BC@bankofny.com... > I Have a computed field in tailor band of a group. I tried to sum > that computed field in summary band using a...

Computing computed field
I Have a computed field in tailor band of a group. I tried to sum that computed field in summary band using another computed expression ..It is displaying 0 instead of sum . I appreciated any help Thanks Sue You can place the expression from the second field in the first one instead of referring to it. Another option (often works) is to apply the GroupCalc DataWindow method (of course outside the expression in the script where you issue Retrieve(), for example.). Sue Sambireddy wrote: > I Have a computed field in tailor band of a group. I tried to sum > t...

Web resources about - Modifying Computed field Expression - sybase.powerbuilder.general

Expression (sign language) - Wikipedia, the free encyclopedia
Signs with two different expressions. The pursed lips and partly closed eyes on the left, and raised lip on the right, are necessary for proper ...

Carmen Sweet by Natalie Weir for Expressions Dance Company at the Q
Less is more in this powerfully impressive dance show. Carmen Sweet , Expressions Dance Company. Choreography: Natalie Weir. Music: Rodion Shchedrin​, ...

Joe Rogan's Facial Expression After Ronda Rousey Got Knocked Out Was Priceless - Bleacher Report
Joe Rogan 's face spoke for us all Saturday night. After UFC superstar Ronda Rousey got knocked out by a lethal kick from Holly Holm, the commentator ...

Jack Dorsey: 'Twitter stands for freedom of expression'
Newly-instated CEO Jack Dorsey laid out Twitter's commitment to open dialogue, in a keynote on stage at today's Twitter Flight developer conference ...

Make your technology a force for musical expression with this digital guitar
Computers, tablets, even iPhones have grown into powerful tools for music making, but for many who play guitar the bridge from analog instrument ...

Computers learn how to spot hidden facial expressions
Machines are good at spotting obvious emotions like smiles, but they're not so hot at detecting the extremely brief microexpressions that reveal ...

Turkey's YouTube Ban Violated Freedom Of Expression, European Court Rules
A YouTube ban in Turkey that lasted two years has now been ruled a violation of the European Convention on Human Rights. Back in 2008, a Turkish ...

Smile!: Impressive Real-Time Facial Expression Transfer
This is a video from Stanford University of a system developed to transfer one person's facial expressions in real time to a live video feed ...

How Facial Recognition Uses Super-Simple Patterns to Understand Your Expression
Facial recognition systems use all kinds of clever software to work out who you are and even how you’re feeling. But in this video explainer, ...

Expressions of Solidarity for France in Red, White and Blue
ABC News Expressions of Solidarity for France in Red, White and Blue ABC News This photograph made available on Saturday Nov. 14, 2015, shows ...

Resources last updated: 12/6/2015 7:17:47 PM