"Crompton, Mark" wrote:
> 
> One of the ways I do it, is through Global variables (I know programmers
> should not use Globals).  With a global array you can resize it inside on of

Not exactly; programmers should not use *uncontrolled* globals.
Even everyone's favorite whipping boy, the lowly-regarded Goto,
has it's place (but 99% of the time that place is the
wastebasket.) Module scope globals are almost required for any
MapBasic dialog beyond the trivial. For those, I just create a
separate module for the dialog, and then use 'dim' to define
globals I need. That way there's little chance that a global
there can foul some other part of the application. 

Defining variables as 'global' instead of 'dim' at the module
level is what I'd call uncontrolled, and should only be done if
you want to live in interesting times. Besides, anyone who
programs in MapBasic already has to compromise his or her sense
of purity to a certain extent. In a language where there are no
function-level static variables and NO private functions
anywhere, you can only be so holy about it. Especially when it
comes to dealing with MapBasic dialog structures. 

Your global array is easily a module-scoped variable, and the use
you make of it is clever, obvious and totally appropriate. I
wouldn't put down the use of globals here.

- Bill Thoen
------------------------------------------------------------
GISnet, 1401 Walnut St., Suite C, Boulder, CO  80302
tel: 303-786-9961, fax: 303-443-4856
mailto:[EMAIL PROTECTED], http://www.ctmap.com/gisnet
------------------------------------------------------------

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to