|
|
|
|
|
- Handling errors
- Operating mode in Windows Vista (and later)
- Carriage Return at the end of line
- Position in the file
<DiskFile variable>.Write (Función) Writes a block of bytes to an external file. Please note Added elements are not inserted into the external file, but overwrite existing elements.
Sintaxis
Escritura de un bloque de bytes en un archivo externo Ocultar los detalles
<Result> = <File used>.Write(<Block to write> [, <Size to write>])
<Result>: Integro - Number of bytes written to the file.
- -1 if an error occurred. To get more details on the error, use ErrorInfo with the errMessage constant.
<File used>: Variable de tipo DiskFile Name of the DiskFile variable initialized with <DiskFile variable>Abrir or <DiskFile variable>.Create. <Block to write>: Cadena de caracteres Block of bytes to must be written to the file (up to 2 GB).The format of the block of bytes is respected. No conversion is performed. <Size to write>: Entero opcional Size of the string to write (in bytes). Observaciones Handling errors <DiskFile variable>.Write throws an error in the following cases: - the file is not opened,
- the file is not accessible in write mode,
- the file is locked by another computer or by another application,
- no disk space is available.
Carriage Return at the end of line <DiskFile variable>WriteLine is used to automatically insert a carriage return (CR) at the end of the added line. To insert a Carriage Return (CR) with <DiskFile variable>.Write, simply use the CR constant. For example:
MonFichier is DiskFile
...
ResEcriture = MyFile.Ecrit("Compte-rendu" + CR + "Ventes de mars 2021")
Position in the file When opening a file, the current position corresponds to: - the first file byte (by default),
- the last byte of the file is the file is opened in "addition" mode (foAdd constant).
<DiskFile variable>.Write writes the specified elements from the current position. Once <DiskFile variable>.Write has been executed, the current position is set to the last byte written. Clasificación Lógica de negocio / UI: Lógica de negocio
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|