Domanda

Is there any significant performance difference between using of Describe method with Evaluate expression in DataWindow control and GetItem... (GetItemString, GetItemDate, GetItemNumber, ...) DataWindow methods?

l_s_ret = l_dw.Describe("Evaluate(~"" + a_s_expression + "~", " + String(a_l_rownumber) + ")")

l_s_ret = l_dw.GetItemDecimal(a_l_rownumber, a_s_expression)

I would like to have one function to get some data from DataWindow control by Describe method with Evaluate expression instead of using GetItem... method for specific data types.

Thanks in advance for your answers.

È stato utile?

Soluzione

Why not loop through a few hundred thousand of each, capturing the CPU() before and after, and let us know? (Besides, in the end, you're the judge of "significant"; to me, if it could possibly be used in a big loop in a batch job, any difference is significant.)

However, just eyeballing it, given the fact that the both will have to do the expensive operations of casting data types, plus Evaluate() has to parse an expression, I'd be surprised if Evaluate() was faster.

If you don't want to reinvent the wheel, PFC has a function that does a version of this: (pfcdwsrv.pbl)pfc_n_cst_dwsrv.of_getitem (). If you don't have a copy of it handy, you can grab a copy from its current site.

Good luck,

Terry

Altri suggerimenti

You can use dot notation to retrieve the data as a string from the datawindow row/column. This not only allows you to get single values but row and/or column values with one line of code.

Matt

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top