PRIVATEs are disappearing 
Author Message
 PRIVATEs are disappearing

   After all these years I'm confused about 'Publics' and 'Privates' ( and yes,
I know I shouldn't be using them but):

   I use 'privates' in my top level routines (e.g., GESC := chr(27),
GBELL:=CHR(7)) so that I can access these vrbls in all lower-level routines. I
normally compile with the switches: /m/n/a/, and have always been able to count
on them being defined at *all* lower levels *except*:

   I'm now puddling with FiveWin, and now one of the routines called by my
BUILDMENU function tries to access one of these variables and it is now
'undefined' ???

   However, if I declare that same vrbl PUBLIC (in the top level routine) it
now becomes Defined !!

   Years ago, I got rid of all my 'publics', and named them all 'private'  and
even in a directly-called routine in my Fivewin test system, my private Gxxx
vrbls are available but NOT in routine 'INVBROW' called as follows:

      MENUITEM "&Inventory" MESSAGE "View/Edit Inventory" ;
                         ACTION INVBROW()

   This statement is part of a routine called 'BUILDMENU' and *it is activated
by the set of statements:
      ACTIVATE WINDOW oWND ;
         ON INIT (INVSETUP(),IIF(GREADY,GOMENU(),oWND:end()))

   (the 'GOMENU' function call contains the Menuitem above)

   If you know about why 'privates' at the top level of an app sometimes
disappear in a deeper function, | would appreciate knowing.

   BTW, I can't visit the Fivewin 'private' Newsgroup until later this month,
and *my* problem seems to be an artifact of Clipper that I've missed all these
years ???

TIA,

-Mel Smith



Fri, 25 Apr 2003 09:31:23 GMT  
 PRIVATEs are disappearing

Quote:
>    I'm now puddling with FiveWin, and now one of the routines called by my
> BUILDMENU function tries to access one of these variables and it is now
> 'undefined' ???

>    However, if I declare that same vrbl PUBLIC (in the top level routine)
> it now becomes Defined !!

This would suggest that the hierarchy of the code involved isn't what you
think it is. Are you really declaring your PRIVATE values at a level higher
than the code that wishes to use them? Can you reproduce your problem in
just a few lines of stand-alone code (as you can imagine, it's hard to say
exactly what the cause is if we can't see exactly what you're doing)?

Quote:
>    Years ago, I got rid of all my 'publics', and named them all 'private'

Why? If you're still using PUBLIC and PRIVATE and you've got public values
why don't you declare them as PUBLIC?

--
Take a look in Hagbard's World: |   w3ng - The WWW Norton Guide reader.
http://www.hagbard.demon.co.uk/ |     eg - Norton Guide reader for Linux.
http://www.acemake.com/hagbard/ |    weg - Norton Guide reader for Windows.
Free software, including........| dgscan - DGROUP scanner for Clipper.



Fri, 25 Apr 2003 03:00:00 GMT  
 PRIVATEs are disappearing

Dave Said:

Quote:

>Why? If you're still using PUBLIC and PRIVATE and you've got public values
>why don't you declare them as PUBLIC?

   Somewhere (in the dark, distant past) I read that one should get rid of
Publics, and only use Privates.  I did so, and everything has worked 'ducky'
since then (until now).

(actually, many people are horrified that anyone should even use 'Privates'.
I've hid this fact for many years -- until now)

  So , until I find out why my hierarchy (for building/activating a menu)
somehow 'hides' my privates from the start-up (Function Main), then I'll have
to go 'Public' -- I guess ?!?

   (but I don't *like* not understanding this quirk !!)

Thanks Dave !!

-Mel Smith



Sat, 26 Apr 2003 11:39:34 GMT  
 PRIVATEs are disappearing

Quote:
> (actually, many people are horrified that anyone should even use
> 'Privates'. I've hid this fact for many years -- until now)

Don't worry, I'm suitably horrified. ;>

Quote:
>   So , until I find out why my hierarchy (for building/activating a menu)
> somehow 'hides' my privates from the start-up (Function Main), then I'll
> have to go 'Public' -- I guess ?!?

>    (but I don't *like* not understanding this quirk !!)

Me too. That's why I'd be interested to see a three function version of your
problem in action. Let us all know what you find either way.

--
Take a look in Hagbard's World: |   w3ng - The WWW Norton Guide reader.
http://www.hagbard.demon.co.uk/ |     eg - Norton Guide reader for Linux.
http://www.acemake.com/hagbard/ |    weg - Norton Guide reader for Windows.
Free software, including........| dgscan - DGROUP scanner for Clipper.



Sat, 26 Apr 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How private are private methods?

2. Non private & private Import

3. private and limited private

4. Private and Limited Private types

5. Private/Limited Private

6. I am not deaf, but am I mute?

7. disappearing and reappearing menu

8. Disappearing ChunkBrowser icons

9. Bad Credit Disappears Like Magic 6454

10. Magically Disappearing Menus

11. desktop icons in Windows disappear

12. Slider disappearing under OS X

 

 
Powered by phpBB® Forum Software