Core Function FilePos

From Sputnik Wiki
Revision as of 10:02, 9 November 2011 by UberFoX (Talk | contribs)
Jump to: navigation, search
FilePos( <file> )

Contents

Description

Get the current POSITION of the File Stream pointer.

Parameters

file

A variable containing the File handle.

Return Value

Success: Returns the File Stream pointer location.

Failure: Returns -1 if error occurs.

Remarks

N/A

Example

$File = FileOpen("MyFile.txt", "w")
If isObj($File, "file") Then ; You could just use isObj($File) however adding the "file" will make sure it is indeed a file
	FileAppend( $File, "This is line 1\n" )
	FileAppend( $File, "This is line 2\n" )
	FileAppend( $File, "This is line 3\n" )
	$CurLocation = FilePos( $File )
	println("The location is: $CurLocation")
	FileClose( $File )
EndIf
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox