* Prg2Vcx.prg
* By CarlKarsten
* converts a procedure file to a vcx class.

* Uses VfpDiff's .aProcs to break the prg into methods, but...
* it expects it to be "properly formated" with ENDPROC at the end of each proc
* and Parameter ilnes, no F(x) declarations.
* and last I checked it didn't do FUNCTIONs.

* I tried to make aProcs smarter and found it was easier to just clean up the PRG:
* search/replace all FUNCTION with PROCEDURE, fix any f(x)'s, etc.
* it took me about 10 attemtps to get it working right.

* Don't forget you will have to convert all internal calls from f(x) to this.f(x)


Local ;
	loForm as Form
	
Local ;
	laProc[1], ;
	laX[1], ;
	loIU as Custom

lcPrgName = "P:\html\temp\SaveClipImage.PRG"
lcPrg = FileToStr( lcPrgName )

Do Form vfpdiff name loForm
loForm.Visible = .f. && get it out of the way
Activate Screen

Create Class "iImageUtils" as custom of d:\vfe\ilibs\iimage.VCX nowait
? ASelObj( laX )
loIU = laX[1]

For lnProc = 1 to loform.aProcs( laProc, lcPrg )
	lcMethodName = laProc[ lnProc, 1 ]
	lcMethodText = "* " + laProc[ lnProc, 2 ]
	loIU.WriteMethod( lcMethodName, lcMethodText, .t. )
endfor

loForm.Release()

return