Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I create a new VCX of subclasses programatically
Message
 
 
To
15/10/1998 01:06:38
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00142974
Message ID:
00147237
Views:
44
Alex,

I just poked around in the memos while writing the PTF book. I read those memo fields in some of the documentation utilities I have written. They are pretty straightforward when you start examining them.

Look in Tom Rettig's PRGTOVCX I think he documented some of the structure in there.

As far as writing a converter (I've been fortunate enough to start from scratch and haven't had to port old apps) I'd be inclined to either make the screen level thisng custom methods of the form, or maybe just leave them as procs in a the routine that starts the form. For screen object snippets you can pretty easily put them into the appropriate methods of the equivalent object. You should be able to use WriteMethod() and not have to worry about the actual .scx fields too much.

Here's some of my original code for what's in Reserved3, this is VFP3 code so VFP5/6 will have a couple of additional indicators for Hidden.
      if ( ! empty( InputFile.Reserved3 ) )
         ?
         ? "Custom Properties and Methods:"
         ?
         lnCustom = memlines( InputFile.Reserved3 ) - 1
         dimension laCustom[m.lnCustom, 4]
         lnLength = 0
         for i = 1 to m.lnCustom
            * parse out name and comment
            lcCustom = mline( InputFile.Reserved3, i )
            j = at( ' ', m.lcCustom )
            if ( j > 0 )
               laCustom[i,1] = left( m.lcCustom, j - 1 )
               laCustom[i,2] = substr( m.lcCustom, j + 1 )
            else
               laCustom[i,1] = m.lcCustom
               laCustom[i,2] = ""
            endif

            * determine whether it's a property, method or array
            c = left( laCustom[i,1], 1 )
            do case
               case ( c == '*' )
                  laCustom[i,3] = 'M'
               case ( c == '^' )
                  laCustom[i,3] = 'A'
               otherwise 
                  laCustom[i,3] = 'P'
            endcase
            if ( laCustom[i,3] != 'P' )
               * strip off marker character
               laCustom[i,1] = substr( laCustom[i,1], 2 )
            endif

            laCustom[i,1] = CorrectCase( laCustom[i,1] )
            laCustom[i,4] = ( laCustom[i,1] $ InputFile.Protected )
            lnLength = max( m.lnLength, len( laCustom[i,1] ) )
         endfor

         * sort properties and methods and output
         = asort( laCustom )
         lnLength = lnLength + 1
         for i = 1 to m.lnCustom
            if ( laCustom[i,4] )
               ? "   Protected "
            else
               ? "   Public    "
            endif
            do case
               case ( laCustom[i,3] $ "PA" )
                  ?? " Property "
               case ( laCustom[i,3] $ "M" )
                  ?? " Method   "
            endcase
            ?? padr( laCustom[i,1], lnLength )
            ?? laCustom[i,2]
         endfor
      else
         lnCustom = 0
      endif
>Where can I find details for tidbits such as this one. I am trying to write an FPD to VFP converter and would like to know where is the best palce to define variables to have scope throughout the form, and where is the best place to place the functions/procedures (without using read-compatibility).
df (was a 10 time MVP)

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

Click here to load this message in the networking platform