Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memory Variables or Form Properties?
Message
De
09/07/1998 18:30:39
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00115561
Message ID:
00115947
Vues:
13
>" instead of using variables, you can reduce memory consumption, increase performance, and simplify programs. "
>
>Simply because PUBLIC variables are always residing in the memory and is available in the entire application as compare to custom properties which are within the FORM only and are released when the FORM releases.

Well, the memory consumption issue is questionable. The memory consumption is the same if you have at least one object instantiated. As soon as you have more than one, it's obvious that the memory consumption is higher with properties than public vars.

Public vars can be released too.

Besides that, I agree that it's usually better to use properties instead of public vars. But not because of memory constraints.

>Same thing with #INCLUDE header files (for #DEFINE, #IF, #IFDEF etc.) which is recommended when you have constant values being used.

This is a little different as #include and #define are evaluated at compile time (precompile time?) and they don't consume memory. A big disadvantage with these directives is that they are very time consuming at compile time. So time consuming that I never use them (obviously, with some exceptions:)).

And I'm not sure that you'll use less memory with #define directives that define large strings.

Vlad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform