set safety off dimension tab(1) set memowidth to 300 *** look for forms directory xl=getdir() close databases all set exclusive on xlp=xl+"*.scx" xx=adir(tabb,xlp) for i=1 to xx xform=fullpath(tabb(i,1)) wait window nowait xform + "[ "+alltrim(str(i))+" / "+alltrim(str(xx))+" ]" use (xform) in 0 xtab=juststem(alltrim(xform)) select (xtab) locate for lower(baseclass)="form" if found() xcode=lower(alltrim(methods)) xlig=atcline("procedure init",xcode) if xlig=0 && no code in init then ad code text TO xcodinit NOSHOW PROCEDURE init *** for form caption with vista ACTIVATE WINDOW (THIS.Name) IN SCREEN NOSHOW thisform.refresh ENDPROC ENDTEXT xcode=xcode+xcodinit else **there code in init so insert it xdeb="" store 0 to _mline && Reset _MLINE to zero xnb=atcline("procedure init",xcode) for count = 1 to xnb && Loop for # of lines in memo field xl= mline(xcode, 1, _mline) && Display each line next xdeb=xdeb+substr(xcode,1,_mline) xcode=substr(xcode,_mline+1) text TO xcodinit NOSHOW *** for form caption with vista activate window (this.name) in screen noshow thisform.refresh *** ENDTEXT xdeb=xdeb+xcodinit if !empty(xdeb) xcode=xdeb+xcode endif endif select (xtab) replace methods with xcode endif endfor close databases all if xx>0 compile form *.scx endif