Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Basic question about inheritance
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00097029
Message ID:
00097179
Views:
19
Joe,

>That would make the most sense....use the SYS(2000) function in a loop and open every SCX and for each appropriate row (determined by the Class memo) add the DoDefault() function to the Methods memo.

MAKE A BACKUP FIRST it's quite easy to hose those memo fields beyond the point that VFP will not be able to open it in the designer anymore. Also once you've modified it issue a COMPILE FORM in your code to get the objcode memo up to date.

>Thanks. Live and learn. You probably covered that in your OOP with Visual FoxPro book, eh?

Right near the front, with color 8x10 glossies with circles and arrows and paragraphs on the back *g* and reiterated numerous times.

>I actually don't have to do this...I just wondered....I will rememeber to issue a DoDefault() when methods are overridden.

>BTW, I have never built a builder...how is that done?

They are wonderfully easy, there's a couple of examples on my website. Here's a copy of the ResetToDefault from the site:
* reset.prg 13-Jul-97

* Usage: select object(s) to be ResetToDefault
* in the command window enter reset()

* Copyright 1997, DF Software Development, Inc.

local i, j, n, m, laObjects[1]

n = aselobj( laObjects )  && all selected objects
if ( n = 0 )
   * nothing to do
   wait window "Select one or more controls to ResetToDefault" nowait
   return
endif

local j, m, lcClass, luObjectValue, luClassValue

for i = 1 to n
   m = amembers( laMembers, laObjects[i] )
   lcClass = laObjects[i].Class
   for j = 1 to m
      if (  pemstatus( laObjects[i], laMembers[j], 0 ) and ;
          ! pemstatus( laObjects[i], laMembers[j], 1 ) )
         * property is overridden and not read only, now check to see 
         * if it's the same as the default

         * NOTE: we have to pull these values out to a memvar, 
         *       getpem() inside an IF fails miserably.
         luObjectValue = getpem( laObjects[i], laMembers[j] )
         luClassValue  = getpem( lcClass,      laMembers[j] )
         if ( luObjectValue == luClassValue )
            * same as class, so reset it
            laObjects[i].ResetToDefault( laMembers[j] )
         endif
      endif
   endfor
endfor
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform