>How can you do Find and Replace code in Visual Fox Pro for the entire application, not just the current form you are editing? I need to change a hard coded drive "USE C:\FOXTEMP\FILENAME.DBF" to a replacable code "USE C:\FOXTEMP\&FILE" throughout the entire application and don't know how to do it.
>
Is this in .PRG files only? If so, then you can use ADIR() to collect the list of files, and use FILETOSTR(), STRTRAN() and STRTOFILE() to convert the files. You may find that you want to use a regular expression for matching purposes, to generalize the search; something like:
oReg = CREATEOBJ('Vbscript.RegExp')
oReg.Global = .t.
oReg.IgnoreCase = .t.
oReg.Pattern = '\s+(C:[\w\\]*\\)(\w*)\.DBF'
n=ADIR(aFiles,'*.PRG')
FOR i = 1 TO n
cStr = FILETOSTR(aFiles[i,1])
cStr = oReg.Replace(cStr,'("$1file")')
? STRTOFILE(cStr,aFiles[i,1])
ENDFOR