Contents

# Put# Statement

Kuusaa faayilii firaa irratti barreessii ykn tartiiba baayitii fayilii lamee irratti.

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.

### Syntax:

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

### Parameters:

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.

Faayilii lameedhaaf(gahiinsa lamee), qubannoo baayitii faayilii keesssatti bakka barreesuu irraa eegaltu.

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

Yaadannoo faayilii firaa: Qabiyyeen faayilii kanaa yoo dheerina kuusaa ibsameen wal gituu baate LenHima haraggoo Banaa iddoon kuusaan haaraan itti barraahe gidduu fi kuusaa itti aanee faayiliirra deetaa jiru faayilii ati irratti barressitu waliin jiifata.

Yaadannoo faayilii lamee: Qabiyyeen gegeedaramaa qubannoo ibsame irratti katabama kana malees faayiliin qareen baayitii dhumaatiin booda sagii kallattiiti. Kuusaa gidduu iddoon hafuu hin qabu.

### Example:

      Sub ExampleRandomAccess
          Dim iNumber As Integer
          Dim sText As Variant REM Must be a variant
          Dim aFile As String
          aFile = "C:\Users\ThisUser\data.txt"
          iNumber = Freefile
          Open aFile For Random As #iNumber Len=32
          Seek #iNumber,1 REM Qubannoo jalqaba irraatti
          Put #iNumber, , "This is the first line of text" ' Fill line with text
          Put #iNumber, , "This is the second line of text"
          Put #iNumber, , "This is the third line of text"
          Seek #iNumber,2
          Get #iNumber, , sText
          Print sText
          Close #iNumber
          iNumber = Freefile
          Open aFile For Random As #iNumber Len=32
          Get #iNumber, 2, sText
          Put #iNumber, , "This is a new text"
          Get #iNumber, 1, sText
          Get #iNumber, 2, sText
          Put #iNumber, 20, "This is the text in record 20"
          Print Lof(#iNumber)
          Close #iNumber
      End Sub

      Sub ExampleRandomAccess
          Dim iNumber As Integer
          Dim sText As Variant REM Must be a variant
          Dim aFile As String
          aFile = "~/data.txt"
          iNumber = Freefile
          Open aFile For Random As #iNumber Len=32
          Seek #iNumber,1 REM Qubannoo jalqaba irraatti
          Put #iNumber, , "This is the first line of text" ' Fill line with text
          Put #iNumber, , "This is the second line of text"
          Put #iNumber, , "This is the third line of text"
          Seek #iNumber,2
          Get #iNumber, , sText
          Print sText
          Close #iNumber
          iNumber = Freefile
          Open aFile For Random As #iNumber Len=32
          Get #iNumber, 2, sText
          Put #iNumber, , "This is a new text"
          Get #iNumber, 1, sText
          Get #iNumber, 2, sText
          Put #iNumber, 20, "This is the text in record 20"
          Print Lof(#iNumber)
          Close #iNumber
      End Sub

Matadureewwan Walfakkatan

Close Statement

Get Statement

Open Statement