Difference between revisions of "WriteStringToFile"
Jump to navigation
Jump to search
imported>Jazzisparis (Created page with "{{Function |origin = JIP |summary = Similar to ReadStringFromFile, only this function <i>writes</i> a string into a file. *If the file does not exist, it is created. *If...") |
imported>Jazzisparis |
||
(One intermediate revision by the same user not shown) | |||
Line 28: | Line 28: | ||
*<i>sourceString</i> supports format specifiers, and up to 20 variables may be used. | *<i>sourceString</i> supports format specifiers, and up to 20 variables may be used. | ||
==See Also== | ==See Also== | ||
*[[ReadStringFromFile]] | |||
*[[ReadArrayFromFile]] | |||
*[[WriteArrayToFile]] | |||
[[Category:Functions_(JIP)]] | [[Category:Functions_(JIP)]] | ||
[[Category:Utility Functions (JIP)]] |
Latest revision as of 15:41, 30 March 2015
< [[::Category:Functions|Category:Functions]]
A function added by the JIP NVSE Plugin.
Description
Similar to ReadStringFromFile, only this function writes a string into a file.
- If the file does not exist, it is created.
- If append is non-zero, the new string is appended at the end of the file, otherwise all existing data is erased and overwritten.
Syntax
(successful:0/1) WriteStringToFile filePath:string append:0/1 sourceString:formattedString formatVars(up to 20)
Example
WriteStringToFile "data_file.txt" 1 $strVar
WriteStringToFile "data_file.txt" 1 "Two times four is %g and no more.%rIts name is %n" intVar refVar
Notes
- filePath is relative to the game's installation path.
- sourceString supports format specifiers, and up to 20 variables may be used.