Object Stream1
String filename, text
Number fileID
If (!OpenDialog(NULL, "Text file", GetApplicationDirectory(2,0) + "xyz.txt", filename)) Exit(0)
fileID = OpenFileForReadingAndWriting(filename)
Stream1 = NewStreamFromFileReference(fileID, 1)
Result("\n Size of file before adding:" + Stream1.StreamGetSize())
Stream1.StreamSetPos(2,0)
Stream1.StreamWriteAsText(0, "\n New add.")
Result("\n Size of the file after adding:" + Stream1.StreamGetSize())
CloseFile(fileID)