描述
跳过下一行读一TextStream文件时.
FreeBASIC 语法
FUNCTION SkipLine () AS HRESULT |
引用文件
CTextStream.inc
示例
#include "windows.bi"
#include "Afx/AfxScrRun.bi"
#include "Afx/CTextStream.inc"
using Afx
' // Create an instance of the CTextStream class
DIM pTxtStm AS CTextStream
' // Open file as a text stream
DIM cwsFile AS CWSTR = ExePath & "\Test.txt"
pTxtStm.OpenUnicode(cwsFile, IOMode_ForReading)
' // Read the file sequentially
DO
' // Ext if we are at the end of the stream
IF pTxtStm.EOS THEN EXIT DO
' // Current line
DIM curLine AS LONG = pTxtStm.Line
' // Skip the 3rd line
IF curLine = 3 THEN
pTxtStm.SkipLine
curLine + = 1
END IF
' // Skip 10 characters
pTxtStm.Skip 10
' // Current column
DIM curColumn AS LONG = pTxtStm.Column
' // Read 5 characters
DIM cwsText AS CWSTR = pTxtStm.Read(5)
' // Skip the rest of the line
pTxtStm.SkipLine
PRINT "Line " + WSTR(curLine) + ", Column " + WSTR(curColumn) & ": " + cwsText
LOOP
PRINT "Press any key..."
SLEEP