Get your own free workspace
View
 

CloseFile

Page history last edited by Gamemaster 3 years, 9 months ago

 

 

CloseFile

Usage:

                CloseFile(Handle)

Description:

The CloseFile command closes a previously opened file, and should always be called when you have finished reading from/writing to a file.

The Handle parameter is the file handle returned by ReadFile, WriteFile or OpenFile.

Example:

                Function Main()
                        F = OpenFile("Test.txt")
                                // Read in current first line and display to user
                                FileData = ReadLine(F)
                                Output(Actor(), FileData)
                                // Return to the beginning of the file and write a new line
                                SeekFile(F, 0)
                                WriteLine(F, "This text will be readable in Notepad")
                        CloseFile(F)
                        Return()

                End Function

Comments (0)

You don't have permission to comment on this page.