4D v16.3

Append document

Home

 
4D v16.3
Append document

Append document 


 

Append document ( document {; fileType} ) -> Function result 
Parameter Type   Description
document  String in Document name or Full document pathname or Empty string for standard file dialog box
fileType  String in List of types of documents to be screened, or "*" to not screen the documents
Function result  DocRef in Document reference number

The Append document command does the same as thing as Open document: it opens a document on disk.

The only difference is that Append document sets the file position at the end of the document while Open document sets its at the beginning of the document.

Refer to Open document for more details about using Append document.

Example  

The following example opens an existing document called Note, appends the string "and so long" and a carriage return onto the end of the document, and closes the document. If the document already contained the string "Good-bye", the document would now contain the string “Good-bye and so long”, followed by a carriage return:

 C_TIME(vhDocRef)
 vhDocRef:=Append document("Note.txt") //Open Note document
 SEND PACKET(vhDocRef;" and so long"+Char(13)) //Append a string
 CLOSE DOCUMENT(vhDocRef) //Close the document



See also 

Create document
Open document

 
PROPERTIES 

Product: 4D
Theme: System Documents
Number: 265

The OK variable is changed by the commandThis command modifies the system Document variableThis command modifies the Error system variableThis command can be run in preemptive processes

 
HISTORY 

Modified: 4D v11 SQL

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)