> As far as style goes, I try to keep my use of globals 
to a minimum.  I'm not
> too fond of variables with file scope either, though.  
Sometimes, though,
> you've just gotta.  (Hey, Palm Guys, how about four 
bytes of user storage in
> the form structure!  Let me get rid of a lot of my 
statics, please.)

In the meantime, what I do is declare a static local 
VoidHand in my form handler, and allocate memory for my 
static variables in the frmOpen case, and store its 
address in the static local VoidHand. It's almost as 
good. And if you want to conserve stack space, you can 
just throw in all the locals that would normally be 
sitting on the stack! If you compile with optimization 
turned on, the end result is that you're accessing your 
locals via an address register different from the stack 
pointer, but big deal.

Of course, don't forget to free the memory when you're 
closing the form.

--
Roger Chaplin <[EMAIL PROTECTED]>

Reply via email to