Meta Project

The Unofficial Meta Documentation

APPEND

Summary

APPEND appends data to a FILE! to write to a file.

Category

FILE-IO GENERAL-IO

Usage

APPEND destination value

Arguments

destination - FIle handle

value - value to append to the FILE!

Refinements

/LINE - Add a NEW-LINE at the end

Description

APPEND appends data to a FILE! to write to a file.

Example Code

Here APPEND is used to write the data in the svg-start string to the file that was opened using the file handle fhandle-out

outputfile: ./myoutput.txt

if not fhandle-out= try OPEN/NEW outputfile [
    write/line "Not able to open output file"
    bye
]

svg-start: {Here is that important data
that must be saved in an output file!
}

append fhandle-out svg-start

If you need to output multiple separate data items and want to or can combine to a single action you can do

append fhandle-out data-item-1
| append data-item-2
| append data-item-3

Or even do it like this

fhandle-out
| append data-item-1
| append data-item-2
| append data-item-..

Related

OPEN  
CLOSE  
TAKE  

Back to the Meta Methods Reference index