Write Command

Purpose

Saves data to sequential files for later read with Input #.

Syntax

Write [#n,]a[,a$, b,...]

n:integer expression, channel
a, b:aexp
a$:sexp

Description

The Write [#n] command is followed by numerical and string expressions which must be separated by commas. Write #n writes these expressions sequentially. The characters are enclosed in quotation marks and commas are generally used as separators.

Note that Write can be used to print to the Form as well.

Example

Local f$ = App.Path + "\Test.Dat", a$, i%

AutoRedraw = 1

Open f$ for Output As # 1

Write # 1, 2 * PI, "Hello GFA", _

Sin(PI ^ 2 / 4)

Close # 1

Open f$ for Input As # 1

For i% = 1 To 3

Input # 1, a$

Print a$

Next i%

Close # 1

Open f$ for Input As # 1

Print "Format of the file: "; _

Input?(LOF(# 1), # 1)

Close # 1

// Tidy-up line

Kill f$

See Also

Print#, Input#

{Created by Sjouke Hamstra; Last updated: 25/10/2014 by James Gaite}