v9.0 (2011)
Writes the given string in a new text file. If the string contains non-ASCII characters, the file will be a windows unicode ("UTF-16") text file compatible with Window's notepad and Softimage's Script Editor. Otherwise, it will be a normal text file. This function is useful to write out text files that could contain japanese characters. XSIUtils.ReadTextFile can be used to read the file back.
XSIUtils.WriteUTF16TextFile( String in_Path, String in_text ); |
oReturn = XSIUtils.WriteUTF16TextFile( in_path, in_string ); |
Returns True if the function succeeded
Parameter | Type | Description |
---|---|---|
in_path | String | Path to the new text file. |
in_string | String | New text of the file |
var file_path = XSIUtils.BuildPath( XSIUtils.Environment("XSI_USERHOME"), "MyTextTestFile.txt" ); var test_text = "Hello, world!"; try { XSIUtils.WriteUTF16TextFile( file_path, test_text ); Application.LogMessage( XSIUtils.ReadTextFile( file_path ) ); } catch (e) { } |