Hi Andrew,

Andrew Douglas Pitonyak wrote:

I've functions in which quite often properties for controls are set.

Thus I could do A)
n times
  oCtrl = oDlgDoc.getControl("name")
  oCtrl.setSomething

or B)  n times
  SetMyControlProp ("name")
which calls
  Sub SetMyControlProp (sN$)
    oCtrl = oDlgDoc.getControl("name")
    oCtrl.setSomething
  End Sub

B) looks cleaner.
However, I've no idea if A or B is faster of better reg. memory usage.

Any ideas?

If I want to know, I place a loop around and count the system ticks to perform the action a few thousand times.

Yes, I do these tests sometimes.

If execution time is sufficient, don't worry about it. If it is a problem, consider storing a reference to the control in a global variable and then access them directly.

Maybe the question as I wrote down, is dependent on more circumstances, so that a simple A or B isn't possible ...

Thanks for your reply,
Cor

--

Cor Nouws
Arnhem - Netherlands
nl.OpenOffice.org - marketing contact

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to