Information générale
Catégorie:
Programmation Orientée Object
Hi Ernie
Like nearly everything in Fox, the class libraries (vcxs) are just tables. Take a look by using and browsing your vcx files (USE {myclass}.VCX - you have to specify the .vcx extension). The VCTs are just the memo files.
You will notice that all the methods for each of the classes are stored in the methods field of the vcx. This is the code that is compiled and then stored in the objcode field which is the code that is actually executed. This is normally handled automatically, but you can force it to happen by issuing the command COMP CLASS {myclass}.
So, the strategy I normally follow before distributing an EXE without the VCX's is this.
Recompile all the classlibs COMP CLASS ...
Open/Use the VCX
Replace all methods with ""
close the VCX
Effectively, this removes the source code from the VCX, but keeps the comiled version. You can even automate this in a little routine. Remeber though, that you do need to keep the source code in your development environment, else you won't be able to develop in the future, so it's best to back up everything before doing this.
You can even take advantage of this by adding code automatically to some classes. Look at the following routing,
USE myclass.vcx
REPLACE ALL methods WITH "PROCEDURE DblClick" + CHR(13) + CHR(10) + ; "THISFORM.SortGrid(THIS)" + CHR(13) + CHR(10) + ;
"ENDPROC" + CHR(13) + CHR(10) ;
FOR class = "header" AND ;
"grdquerygrid" $ LOWER(parent) AND ;
EMPTY(methods)
USE
COMP CLASS myclass.vcx
This automatically adds a call in the DblClick event to sort the grid. Cool eh.
Anyway, got to go
Have fun
Mace
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement