Write Statement

Conteníu
Índiz 🔎︎

# Write# Statement

Writes data to a sequential text file with delimiting characters.

Use Print# statement to print data to a sequential text file. Use Put# statement to write data to a binary or a random file.

### Syntax:

    Write [#fileNum] {,|;} expression [, …]

### Parameters:

fileNum: Any numeric expression that contains the file number that was set by the Open statement for the respective file.

expression list: Variables or expressions that you want to enter in a file, separated by commas.

Si s'omite la llista d'espresiones, la instrucción Write amiesta una ringlera balera al ficheru.

P'amestar una llista d'espresiones a un ficheru nuevu o esistente, ésti ten de tar abiertu col mou Output o Append.

Les cadenes que pues escribir estan encapsulada por comines y separáu por comes. Nun precises poner estos delimitantes nuna llista d'espresión.

Cada instrucción de Write xenera un simbolo de saltu de llinia a la última entrada.

Númberos con dellimitadores decimales son convertíos d'alcuerdu nala configuración del idioma o rexonalización.

### Example:

      Sub ExampleWrite
          Dim iCount As Integer
          Dim sValue As String
          iCount = Freefile
          Open "C:\Users\ThisUser\data.txt" For Output As iCount
          sValue = "Hamburg"
          Write #iCount,sValue,200
          sValue = "New York"
          Write #iCount,sValue,300
          sValue = "Miami"
          Write #iCount,sValue,450
          Close #iCount
      End Sub

      Sub ExampleWrite
          Dim iCount As Integer
          Dim sValue As String
          iCount = Freefile
          Open "~/data.txt" For Output As iCount
          sValue = "Hamburg"
          Write #iCount,sValue,200
          sValue = "New York"
          Write #iCount,sValue,300
          sValue = "Miami"
          Write #iCount,sValue,450
          Close #iCount
      End Sub

Temes rellacionaos

Open Statement

Print# Statement

Put# Statement

Close Statement