[api-dev] Question reg. Sound programming in Basic
Hi, 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? Thanks, Cor -- Cor Nouws Arnhem - Netherlands nl.OpenOffice.org - marketing contact - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Question reg. Sound programming in Basic
Cor Nouws wrote: Hi, 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? Thanks, Cor If I want to know, I place a loop around and count the system ticks to perform the action a few thousand times. 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. -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.odt My Book: http://www.hentzenwerke.com/catalog/oome.htm Info: http://www.pitonyak.org/oo.php See Also: http://documentation.openoffice.org/HOW_TO/index.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Question reg. Sound programming in Basic
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]