FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour for performance of executable
Posts: 61
Joined: Wed Jul 26, 2023 12:08 PM
for performance of executable
Posted: Mon Jul 01, 2024 07:16 PM
Dear Friends,

Which of the lines I marked should be used for more application performance?
Is there any difference between them in terms of performance?

Code (fw): Select all Collapse
#include "Fivewin.ch"

[b]STATIC oDBServer                  <--- for sql[/b]

FUNCTION Main
 LOCAL oApp

 oApp := MyApp():New():Run()

RETURN nil

CLASS MyApp FROM TMdiFrame

[b]DATA oDBServer                    <--- for sql[/b]

ENDCLASS

-----------------------------

CLASS TWindow
.....
[b]DATA oParent                                <---[/b]
.....
ENDCLASS

-------- OR ---------

[b]__objAddData( oMain, "oModule" )  <---[/b]

oMain:oParent := oModule
Best regards,
Ertan
Best regards,
Ertan,

ertan_ozturk@yahoo.com
Posts: 61
Joined: Wed Jul 26, 2023 12:08 PM
Re: for performance of executable
Posted: Mon Jul 01, 2024 07:24 PM
Sorry,
Code (fw): Select all Collapse
oChild:oParent := oModule
Best regards,
Ertan
Best regards,
Ertan,

ertan_ozturk@yahoo.com
Posts: 61
Joined: Wed Jul 26, 2023 12:08 PM
Re: for performance of executable
Posted: Mon Jul 01, 2024 08:33 PM
oParent wrong variable name. oWnd == oParent

This is correct code.
Which is correct choice for this two state?



Best regards,
Ertan
Best regards,
Ertan,

ertan_ozturk@yahoo.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: for performance of executable
Posted: Mon Jul 01, 2024 09:20 PM

They are for different purposes. Module level STATIC (ie. a STATIC defined outside any functions) is a single variable that all the functions in the module can see. DATA instance variable is a variable incapsulated inside an object instance (ie. one different variable with the same name for each object instance). You have to choose the right one for your needs not for its performance.

Posts: 61
Joined: Wed Jul 26, 2023 12:08 PM
Re: for performance of executable
Posted: Mon Jul 01, 2024 09:22 PM

Thank you so much Enrico

Best regards,

Ertan

Best regards,
Ertan,

ertan_ozturk@yahoo.com

Continue the discussion