Home > Language Reference > File Functions > CreateUnicodeFile

CreateUnicodeFile

The CreateUnicode function creates a file using Unicode encoding.

Usage

Used to force a subsequent Write function to write in a new file using Unicode encoding.

Syntax

ret=CreateUnicode(<filename>)

Parameters

<filename>, string, name of the file to be created. If the file already exists, it is deleted and recreated. The Byte-Order Mark (BOM) is written at the beginning of the empty file, this byte is then detected by Write function for writing data in this new file using Unicode encoding

Return value

ret, optional numeric return value. If the function has successfully created the file, the return value is 0. If the function fails, the return value is a nonzero value (see File Functions Error Codes). 

See also

Create
Exist
Kill
Write

Examples

' If c:\wttest folder exists
CreateUnicodeFile("c:\wttest\test.txt")

'If c:\bla does not exist, the return code is a nonzero value
'Ignore Errors
#IgnoreErrors=1
ret=CreateUnicodeFile("c:\bla\test.txt")
msgbox(ret)