|
|
|
|
- Error management
- Operating mode in Windows Vista (and later)
Creates an external file. This file is automatically opened in read/write. Remarks: Syntax
Create an external file and associate it with an DiskFile variable Hide the details
<Result> = <DiskFile>.Creates(<File path> [, <Creation options>])
<Result>: Boolean - if the file has been opened and associated with Variable of type DiskFile,
- False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
<DiskFile>: DiskFile variable Name of the Variable DiskFile that will be associated with the manipulated text file. <File path>: Character string Name and full (or relative) path of file (up to 260 characters). The extension of the file can be specified. By default, if the file extension is not specified, the external file will have no extension. A UNC path can be used.Remark: If the external file already exists (same directory and same name), this file is destroyed and re-created. To avoid deleting an existing file, use .Open associated with the foCreateIfNotExist constant. <Creation options>: Combination of optional constants Options for file creation: - Lock options: A lock can be implemented when the external file is opened:
| | foAutomaticDeletion | The file is locked when opened, and will be automatically deleted when closed (when <DiskFile variable>.Close is called, or when the application is closed). If multiple applications are using the file, it will be automatically deleted when the last application closes it (when <DiskFile variable>.Close is called, or at the end of the application). | foReadLock | The file will be created in read-only. The other applications that use this file will not be able to read it. | foWriteLock | The file will be created in write-only. The other applications that use this file will not be able to modify it. |
- Type of external file to create. This type is used by <DiskFile variable>.ReadLine and <DiskFile variable>.WriteLine to define the type of information to read and write in the external file:
| | foAnsi | Ansi file. This constant is used to manage an Ansi file when the "Use Unicode strings at runtime" mode is enabled in the project configuration. This mode is used by default in the WINDEV and WEBDEV projects. | foUnicode | Unicode file. This constant is used to manage a Unicode file when the "Use Ansi strings at runtime" mode is enabled in the project configuration. This mode is used by default in WINDEV Mobile projects. |
By default, if no constant is specified: - the external file can be freely accessed by the other applications,
- the type of the file corresponds to the default mode.
Error management Create throws an error in the following cases: - the file is locked by another computer or by another application,
- the user has no write rights in the creation directory.
- a Unicode string was used for <File path> in an operating system such as Windows 98 or Windows Me.
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|