{{fbdoc item="title" value="APPEND"}}----
Specifies text file to be opened for append mode

{{fbdoc item="syntax"}}##
	[[KeyPgOpen|open]] //filename// for **Append** [[[KeyPgEncoding|encoding]] //encoding_type//] [[[KeyPgLock|lock]] //lock_type//] as [#]//filenum// 
##
{{fbdoc item="param"}}
	##//filename//##
		file name to open for append
	##//encoding_type//##
		indicates encoding type for the file
	##//lock_type//##
		locking to be used while the file is open
	##//filenum//##
		unused file number to associate with the open file

{{fbdoc item="desc"}}
	A file mode used with ##[[KeyPgOpen|Open]]## to open a text file for writing.
	
	This mode is used to add text to an existing file  with ##[[KeyPgPrintPp|Print #]]##, or comma separated values with ##[[KeyPgWrite|Write#]]##.
	
	Text files can't be simultaneously read and written in ""FreeBASIC"", so if both functions are required on the same file, it must be opened twice.
	
	##//filename//## must be a string expression resulting in a legal file name in the target OS, without wildcards. The file will be sought for in the present directory, unless the ##//filename//## contains a path . If the file does not exist, it is created. The pointer is set after the last character of the file.
	
	##//Encoding_type//## indicates the Unicode ##[[KeyPgEncoding|Encoding]]## of the file, so characters are correctly read. If omitted, "ascii" encoding is defaulted. Only little endian character encodings are supported at the moment. 
		-##"utf8"##
		-##"utf16"##
		-##"utf32"##
		-##"ascii"## (the default)
	
	##//Lock_type//## indicates the way the file is locked  for other processes, it is one of:
		- ##**Read**## - the file can be opened simultaneously by other processes, but not for reading
		- ##**Write**## - the file can be opened simultaneously by other processes, but not for writing
		- ##**Read Write**## - the file cannot be opened simultaneously by other processes (the default)
	
	##//filenum//## Is a valid FreeBASIC file number (in the range ##1..255##) not being used for any other file presently open. The file number identifies the file for the rest of file operations. A free file number can be found using the ##[[KeyPgFreefile|Freefile]]## function.

{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/fileio/for-append.bas"}}%%(freebasic)
dim i as integer
FOR i = 1 to 10
	OPEN "test.txt" FOR APPEND as #1
	PRINT #1, "extending test.txt"
	CLOSE #1
NEXT
%%
{{fbdoc item="diff"}}
	- None

{{fbdoc item="see"}}
	- ##[[KeyPgInputfilemode|Input (File Mode)]]##
	- ##[[KeyPgOpen|Open]]##
	- ##[[KeyPgOutput|Output]]##
	- ##[[KeyPgPrintPp|Print #]]##
	- ##[[KeyPgPrintPp|? #]]##
	- ##[[KeyPgWrite|Write #]]##

{{fbdoc item="back" value="CatPgFile|File I/O Functions"}}