Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Variable
Message
De
19/05/2005 22:22:45
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
19/05/2005 21:38:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01015673
Message ID:
01016091
Vues:
10
>First of all, Thank you so much,brad and hilmar,Thanks for your valuable opinion.As a result, Using cursor is better than using global variable?It sound like good,but will cursor occupy more memory than using global variable?I not really know about it, can u tell me?Thanks!!

Cursors may be either on disk or in memory. Variables are in memory. It won't make much difference, unless you have very long strings. Also, in both cases, they are automatically released with the form (assuming you use private variables, or, in the case of cursors, if the form has a private DataSession).

I suspect the reason Brad prefers cursors, is to avoid having multiple variables. But you could also have a single object variable, with several properties.

Storage space is not really an issue; but global variables should be avoided in most cases, to keep your program tidy and safe. If you can't make it work with private variables, a cursor is "private" to the form that creates it. It is also available in the report called from the form, but in other forms, it will be invisible. This helps keep your program organized.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform