PWriteFile

From GECK
Jump to: navigation, search


A function added by the pp NVSE Plugin.

Description

Works like WriteArrayToFile, but instead accepts an array of strings, writing every index to a line in the file. myArray[0] == line 1, myArray[5] == line 6 etc.

Syntax

[help]
(bool) pWriteFile FilePath:string sourceArray:array Append:bool

Example

Ar_Append aMyArray "CloneModifierFloat"
Ar_Append aMyArray "Hello"
pWriteFile "Data\NVSE\plugins\NVWO_Templates\WeaponAttachments\WAP_AttachmentGlobals.ini" aMyArray 1

Adds "CloneModifierFloat" and "Hello" to the end of WAP_AttachmentGlobals.ini

Ar_Append aMyArray "CloneModifierFloat"
Ar_Append aMyArray "Hello"
pWriteFile "Data\NVSE\plugins\NVWO_Templates\WeaponAttachments\WAP_AttachmentGlobals.ini" aMyArray

Overwrites WAP_AttachmentGlobals.ini, leaving a text file with only two lines: "CloneModifierFloat" and "Hello".

Notes

  • filePath is relative to the game's installation path.
  • the sourceArray should be a filled with only strings. idk what will happen if you have an int, or reference.

See Also