Instrución Put#

Escribe un rexistro nun ficheiro relativo ou unha secuencia de bytes nun ficheiro binario.

tip

Use Print# statement to print data to a sequential text file. Use Write# statement to write data to a sequential text file with delimiting characters.


Sintaxe:

Put Statement diagram


Put [#]fileNum, [recordNum|filePos], variable

Parámetros:

fileNum: Any integer expression that defines the file that you want to write to.

recordNum, filePos: For relative files (random access files), the number of the record that you want to write.

En ficheiros binarios (acceso binario), a posición do byte no ficheiro onde desexa iniciar a escritura.

variable: Name of the variable that you want to write to the file.

Note for relative files: If the contents of this variable does not match the length of the record that is specified in the Len clause of the Open statement, the space between the end of the newly written record and the next record is padded with existing data from the file that you are writing to.

Nota para ficheiros binarios: O contido das variábeis escríbese na posición especificada, e o apuntador do ficheiro insírese directamente despois do último byte. Non permanece ningún espazo entre os rexistros.

Exemplo:

Precisamos da súa axuda!