A little Q/A about Global Variables
I've started to use this program called Gambas for Linux (a basic program) and I was reading the help file about differences between Gambas and VB, and it said it had got rid of declaring global variables because it is bad practice. Is this right? If so, then how is it?
Re: A little Q/A about Global Variables
One problem could be that, being global, thhey could be changed unexpectedly.
Re: A little Q/A about Global Variables
Quote:
Originally Posted by Pasvorto
One problem could be that, being global, thhey could be changed unexpectedly.
Correct....having said that, however, if you are paying attention to what you are doing, this will not be an issue.
Re: A little Q/A about Global Variables
It's not 'bad' per se: it depends upon your choice of development paradigm.
edit: opinion removed.
second edit: gratuitous acute accent removed.
Re: A little Q/A about Global Variables
AS with anything else, it's all bout using the right tool for the right job. As a general practice, I avoid them when possible. However, from time to time they come in handy.
-tg
Re: A little Q/A about Global Variables
Quote:
Originally Posted by techgnome
As a general practice, I avoid them when possible.
I agree....typically I will have a global recordset object and a global string for SQL statements, but, by in large, the rest of my variables are Private at the form level.