Web Home
Getting Started
Manual
Packages
Quick Reference
Language Reference
Function Reference
I/O Reference

- Language Reference
- Function Reference
- I/O Reference
  - Opening and Closing Text Files
  - Reading Text
  - Writing Text
  - Positioning a Text File
  - Opening and Closing Binary Files
  - Saving and Restoring Variables
  - Reading History Records
  - Writing History Records
  - Opening Non-PDB Files
  - Making Plots
  - Plot Paging and Hardcopy
  - Setting Plot Limits
  - Managing Graphics Windows
  - Graphics Query, Edit, and Defaults

# Yorick I/O Reference

## Writing History Records

To write a family of files containing history records:

1. Create the file using `createb`.
2. Write all of the non-record (time independent) variables to the file using `save`.
3. Create a record which will correspond to time time and cycle ncyc for future `jt` and `jc` commands. Use:
   `add_record, f, time, ncyc` make new record at time, ncyc
4. Write all record (time dependent) variables to the file using `save`. After the first `add_record`, `save` will create and store record variables instead of non-record variables as in step 2.
5. Repeat steps 3 and 4 for each new record you wish to add to the file. For the second and subsequent records, `save` will not allow variables which were not written to the first record, or whose data type or shape has changed since the first record. That is, the structure of all history records in a file must be identical. Use type `pointer` variables to deal with data which changes in size, shape, or data type.

After each `add_record`, any number of `save` commands may be used to write the record.

If the current member of a history record file family has at least one record, and if the next record would cause the file to exceed the maximum allowed file size, `add_record` will automatically form the next member of the family. The maximum family member file size defaults to 4 MBytes, but:

`set_filesize, f, n_bytes` set family member size