Reference Guide > W Routines > WriteU Procedure
  

WriteU Procedure
Writes binary (unformatted) data from an expression into a file.
Usage
WriteU, unit, expr1, ... , exprn
Input Parameters
unit — The file unit to which the output will be sent.
expri — Expressions to be output. For nonstring variables, the number of bytes contained in expr is output. For string variables, the number of bytes contained in the existing string is output.
Keywords
None.
Discussion
WRITEU performs a direct transfer, with no processing of any kind being done to the data.
Example
In this example, WriteU is used to write some data to a file. The READU procedure could then be used to read the data from the file.
; Create some data. Argument d contains a 200-by-200 byte array.
d = BYTSCL(REFORM(FIX(100 * RANDOM(40000)), 200, 200))
 
; Open the file wuex.dat for writing.
OPENW, unit, 'wuex.dat', /Get_Lun
; Write the data in d to the wuex.dat file.
WriteU, unit, d
; Close the file and free the file unit number.
FREE_LUN, unit
See Also
OPEN (UNIX), OPEN (Windows), READ
For more information and examples, see the PV‑WAVE Programmer’s Guide.

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.