UseFile()
Syntax
UseFile(#File)Description
Change the current used file to the given one.
file$ = OpenFileRequester("Select a file","","Text (.txt)|*.txt|All files (*.*)|*.*",0) If file$ If ReadFile(0,file$) And CreateFile(1,"test.txt") UseFile(0) ; make the selected file the actual file (for reading) a$ = ReadString() ; read one line from this file UseFile(1) ; make the 'test.txt' file the actual file (for saving) WriteStringN(a$) ; write the previously read line in this file CloseFile(0) ; close first file CloseFile(1) ; close second file (and store the data this way) EndIf EndIf
Supported OS
All