GotoFirstLine()

var textObj = OpenFile("d:\\myText.txt")
textObj.GotoFirstLine()
textObj.WriteLine("Hello World")

Note:

Pathnames normally contain backslashes e.g. d:\welcome.txt, all single backslashes should be entered as double backslashes i.e. d:\\welcome.txt.

Close