CFile:new


The new method creates an instance of the CFile class.If the object cannot be created, nil is returned. As an alternative to using this constructor followed by the Open method, you can use the global FileOpen method to both construct the CFile object and open the file. The CFile object may also be constructed using the new_file function.

Note: This method's name uses all lower case to present it as the analog of the C++ new operator. Generally, the names of class methods begin with an uppercase letter but new and delete are different.

Example

F = CFile:new()

-- create a new instance of F of the CFile class.

  ...

-- other uses of the class go here, before delete.

F:delete()

-- deletes the object and its associated memory.

Related Topics

CFile class, delete, FileOpen, new_file


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.