>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)