WriteArrayToFile

From GECK
Jump to: navigation, search


A function added by the JIP NVSE Plugin.

Description

Similar to ReadArrayFromFile, only this function writes data from an array variable into a file.

  • If the file does not exist, it is created.
  • If append is non-zero, the new data is appended to any existing data in the file, otherwise all existing data is erased and overwritten.
  • In cases where the passed array is a matrix (2D array), each sub-array is treated, and is written into the file as a column, unless the 4th, optional argument, transpose, is non-zero, in which case each sub-array is treated and written as a row.
  • Only the values from the array are written; keys are ignored.

Syntax

[help]
(successful:0/1) WriteArrayToFile filePath:string append:0/1 sourceArray:array_var transpose:1/0

Example

WriteArrayToFile "data_file.txt" 1 arrVar 

Notes

  • filePath is relative to the game's installation path.

See Also