I agree they are a bad thing in general, however there is a lot of
situations where they are by far the most effecient method to use. eg theres
no point passing around a variable which is used in nearly every function.
Placing them in a database would be very slow. Its just a matter of common
sence. I tend to use module wide variables quite a lot for speed, but if you
keep your modules sensible it can create nice neat, easy to read code. Using
this method you can create object orientated C, where you object data is
module wide, but hidden from the outside world, and accessed through
functions.

Rik

> -----Original Message-----
> From: Richard M. Hartman [SMTP:[EMAIL PROTECTED]]
> Sent: 13 February 2001 01:00
> To:   Palm Developer Forum
> Subject:      Re: Global Variables
> 
> Despite everyone saying that globals are supported, I have
> to pop in here and say that using them is a Bad Thing (tm).
> Find another way.
> 
> For the Palm, there is always stuffing them in a database (Dm*),
> or store them as preferences (Pref*), or (probably the easiest)
> a feature (Ftr*).
> 
> --
> -Richard M. Hartman
> [EMAIL PROTECTED]
> 
> 186,000 mi/sec: not just a good idea, it's the LAW!
> 
> Mike Lyle wrote in message <39037@palm-dev-forum>...
> >
> >As a new palm developer coming from the Windows environment I find not
> >having global variables a real problem.  Does anyone have a work around
> >for variables that are required by several procedures?
> >
> >Thanks,
> >Mike Lyle
> >
> >
> >
> >
> 
> 
> 
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to