Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Include File In VCX
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00522874
Message ID:
00522892
Views:
8
>I have created an include file that I want to use in all the classes in my vcx.
>My question is where do I #include it? Do I have to #include it in every method or can I just put it in one place that will be seen by the entire library?

_INCLUDE is helpful but does not always guarantee success. What I did was create 2 macros, 1 for classes and 1 for forms. This is the code for each macro, respectively:
{ALT+C}i{TAB}{TAB}d:\amcowin\defaults.h{ENTER}{CTRL+W}

{ALT+M}i{TAB}{TAB}d:\amcowin\defaults.h{ENTER}{CTRL+W}
Then I ran a little PRG to do all this for me:
clear
set escape on
on error do ErrTrap in Program()
on escape suspend
DoForms()
DoClasses()
on escape
on error
return

procedure DoForms
*
lnRetVal = adir(laForms, 'forms\*.scx')
asort(laForms)
for lnI = 1 to lnRetVal
   lcForm =  laForms[lnI, 1]
   keyboard '{ALT+H}'
   modi form (lcForm)
   ? lcForm
endfor
return

procedure DoClasses
*
lnRetVal = adir(laLibraries, 'classes\*.vcx')
asort(laLibraries)
for lnI = 1 to lnRetVal
   lcLibrary = laLibraries[lnI, 1]
   lnClasses = avcxclasses(laClasses, lcLibrary)
   asort(laClasses)
   for lnJ = 1 to lnClasses
      && slow down so previous class has chance to release and
      && clear class from memory. may not always be long enough
      =inkey(2)
      lcClass = laClasses[lnJ, 1]
      keyboard '{ALT+V}'
      modi class (lcClass) of (lcLibrary)
      ? lcLibrary + ": " + lcClass
   endfor
endfor
return

procedure ErrTrap
*
release laError*
public array laError[1]
aerror(laError)
suspend
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform