Functions.FReadLine 方法 |
命名空间: XSharp.RT
FUNCTION FReadLine( ptrHandle, nMax ) AS STRING CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })] public static string FReadLine( __Usual ptrHandle = default, __Usual nMax = default )
1ptrHandle := FOpen2("docs.txt", FO_READ) 2IF ptrHandle != F_ERROR 3 DO WHILE !FEOF(ptrHandle) 4 ? FReadLine(ptrHandle) 5 ENDDO 6ENDIF 7FClose(ptrHandle)
1FUNCTION Grep(cSearch, cFile AS STRING) ; 2 AS DWORD PASCAL 3 LOCAL handle AS PTR 4 LOCAL Count AS DWORD 5 LOCAL Line AS STRING 6 Line := " " 7 handle := FOpen2(file, FO_READ) 8 cSearch := Upper(cSearch) 9 DO WHILE !FEOF(handle) 10 line := Upper(FReadLine(handle)) 11 IF InStr(cSearch, line) 12 ? line 13 Count += 1 14 ENDIF 15 ENDDO 16 RETURN Count