Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datawindows computed column

Status
Not open for further replies.

kidmar

Programmer
Mar 2, 2006
17
IT
hi.
I have a datawindow with a computed column.the value of the computed column is the result of a global function (written by me.located in a pbl).
I tried to put a brakepoint in the global function.
debugging, if the computed field is shown, the program calls the function withot stopping (100% cpu usage).
if i use the HScrollBar to "hide" the computed field everything works fine and the function is no more called.
the point is: if i can see the computed field the datawindow calls the function continuously, otherwise not.
oh, I never call that function within the code.
can someone help please?
thank you!
 
What is the function doing? Is there some other way to achieve the result without using it?

Matt

"Nature forges everything on the anvil of time
 
The function gets a value from the database with an SQL SELECT (a bit heavy) and returns that value (modified).
I couldn't find another way to do that
I have that problem in every datawindow that has a computed column valued with a function, but this one is so heavy that the pc is slowed down (3Ghz :( )
I dont think an event can occur if the field is displayed, so I think that is a PowerBuilder(Datawindow) problem/bug/property.
Anyway, I'm using PB 9.0.1 build 7119
 
I suppose you could try using a hidden datawindow to do the actual retrieval from the database and your global function calls. Once the data is retrieved use the sharedata or rowscopy to get the data to the other 'display' datawindow.

Matt

"Nature forges everything on the anvil of time
 
I finally did it.
I tried with the hidden Datawindow but it had a really slow retrieve ( about 1 min ) because it had to execute the function (and the select) a lot of times.
Then I made a Datawindow with the SQL SELECT of the function. I used filters and GetItem to get the value I needed and put it in the computed field with a SetItem. I have to do that for about 1000 rows ( ~5 sec ) but works and is really better then pc stuck!!
thank you for help mbalent!

ps: I still can't figure out why my computed colums calls functions without stopping if shown
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top