|
-
Feb 16th, 2007, 08:53 AM
#1
Thread Starter
Fanatic Member
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?
-
Feb 16th, 2007, 08:54 AM
#2
PowerPoster
Re: A little Q/A about Global Variables
One problem could be that, being global, thhey could be changed unexpectedly.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Feb 16th, 2007, 09:01 AM
#3
Re: A little Q/A about Global Variables
 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.
-
Feb 16th, 2007, 09:16 AM
#4
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.
-
Feb 16th, 2007, 09:37 AM
#5
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
-
Feb 16th, 2007, 09:42 AM
#6
Re: A little Q/A about Global Variables
 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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|