Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing the parent class of an existing form
Message
From
26/11/1998 12:55:42
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
26/11/1998 12:54:05
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00161804
Message ID:
00161811
Views:
21
>>>I have an app with forms based on the default VFP base forms. Now that I know more about OOP, I want to change these forms so they are based on a subclass of the VFP base form. Is there a way to do this without having to copy the methods and objects in each existing form to a new one, or is there a low level shortcut for doing this?
>>>
>>>Mon
>>I liked the "low level" idea :) It could be done via "medium level". Open the form (.scx) as a table, find the object with baseclass = "Form", change Class, Classloc properties.
>>Cetin
>Batch code (make backups first:)
lparameters tcClass, tcClassLoc
>lcFormDir = getdir()
>if empty(lcFormdir)
> return
>endif
>nFiles = adir(aSCX,lcFormDir+"*.scx)
>for ix = 1 to nFiles
<del>  use (aSCX[ix])</del>
  use (aSCX[ix,1])
>  replace class with tcClass, classloc with tcClassLoc ;
>   for baseclass = "Form"
>  use
>endfor
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform