*------------------------------------------------------------------------ * syIsFuncDefined() * Check if a function is defined in a PRG file. * * PARAMETERS: * tcFuncName - name of function, case insensitive * tcPrgFile - full path to the PRG file. * * RETURNS: * .t. if function is defined, .f. otherwise. * * EXAMPLE: * llDefined = syIsFuncDefined('UnitTest','c:\path\utilapp.prg') * * NOTES * 1. return .f. is the PRG file does not exist * *------------------------------------------------------------------------ function syIsFuncDefined(tcFuncName, tcPrgFile) local lnCount, laProc[1], llDefined, lnRow if vartype(tcFuncName)<>'C' or empty(tcFuncName) ; or vartype(tcPrgFile)<>'C' or empty(tcPrgFile) ; or not file(tcPrgFile) return .f. endif llDefined = .f. lnCount = aprocinfo(laProc, tcPrgfile) lnRow = ascan(laProc, tcFuncName, 1, lnCount, 1, 15) if lnRow<>0 and lower(laProc(lnRow,3))=='procedure' llDefined = .t. endif return llDefined endfunc