СЛУЧАЙНЫЕ ФАЙЛЫ для добавления записей в текстовый файл, но вместо того, чтобы они отображались в разных строках, они записывались в одной строке - PullRequest
0 голосов
/ 29 мая 2020

вот как я открываю файл:

FileOpen(1, TxtChosenFile.Text, OpenMode.Random, , , Len(ObjItem))

это структура:

Private ObjItem As New item
Private NewObjItem As New item

Structure item
    Dim id As Integer
    <VBFixedString(30)> Dim description As String
    Dim type As String
    Dim quantity As Integer
    Dim UnitPrice As Integer
End Structure

и код ввода кнопки:

ObjItem.description = TxtDescription.Text
ObjItem.id = TxtItemNumber.Text
ObjItem.quantity = TxtQantity.Text
ObjItem.type = CmbType.Text
ObjItem.UnitPrice = TxtUnitPrice.Text

temp = ObjItem.id 
       & "," & 
       ObjItem.description
       & "," & 
       ObjItem.type
       & "," &
       ObjItem.quantity
       & "," & 
       ObjItem.UnitPrice

FilePutObject(1, temp, RecordNumber:=TxtItemNumber.Text
...