Skip Method |
Description
Skips a specified number of characters when reading a TextStream file.
PowerBASIC Syntax
Arguments
Remarks
Skipped characters are discarded.
Example [PowerBASIC]
#INCLUDE "windows.inc" #INCLUDE "scrrun.inc"
DIM fso AS IFileSystem DIM pStm AS ITextStream DIM curLine AS LONG DIM strText AS STRING
' Create an instance of the FileSystemObject fso = NEWCOM "Scripting.FileSystemObject" ' Open the file for reading pStm = fso.OpenTextFile(UCODE$("C:\MyFolder\Test.txt"), %IOMode_ForReading, %FALSE, %FALSE) ' Read the file sequentially WHILE ISFALSE pstm.AtEndOfStream ' Current line curLine = pStm.Line IF curLine = 3 THEN ' Skip the 3rd line pStm.SkipLine curLine = curLine + 1 END IF ' Skip 10 characters pStm.Skip 10 ' Current column curCol = pStm.Column ' Read 5 characters strText = pStm.Read(5) ' Skip the rest of the line pStm.SkipLine STDOUT "Line " & FORMAT$(curLine) & ", Column " & FORMAT$(curCol) & ": " & ACODE$(strText) WEND ' Close the file pstm.Close
|