Home > Language Reference > File Functions > Create

Create

The Create function creates a file.

Usage

Used to create a file before using it.

Syntax

ret=Create(<filename>)

Parameters

<filename>, string, name of the file to be created. If the file already exists, it is deleted and recreated.

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

CreateUnicodeFile
Exist
Kill
Write

Examples

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

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