LibreOffice 7.1 Help
рд╕рдореНрдмрдиреНрдзрд┐рдд рдлрд╛рдЗрд▓рдмрд╛рдЯ рд░реЗрдХрд░реНрдб рдкрдвреНрджрдЫ, рд╡рд╛ рдЪрд▓рдорд╛ рдмрд╛рдЗрдирд░рд┐ рдлрд╛рдЗрд▓рдмрд╛рдЯ рдмрд╛рдЗрдЯреНрд╕рдХреЛ рдЕрдиреБрдХреНрд░рдо ред
рдпреЛ рдкрдирд┐ рд╣реЗрд░реНрдиреБрд╣реЛрд╕реН:PUTрдХрдерди
Get [#]fileNum, [recordNum|filePos], variable
fileNum: Any integer expression that determines the file number.
recordNum: For files opened in Random mode, recordNum is the number of the record that you want to read.
For files opened in Binary mode, filePos is the byte position in the file where the reading starts.
If recordNum and filePos are omitted, the current position or the current data record of the file is used.
variable: Name of the variable to be read. With the exception of object variables, you can use any variable type.
Sub ExampleRandomAccess
Dim iNumber As Integer
рдЪрд▓ REM рдХреЛ рд░реВрдкрдорд╛ Dim sText рдЪрд▓ рдиреИ рд╣реБрдиреБрдкрд░реНрджрдЫ ред
Dim aFile As String
aFile = "c:\data.txt"
iNumber = Freefile
Open aFile For Random As #iNumber Len=32
рд╕реБрд░реБрдХреЛ рд╕реНрдерд┐рддрд┐рдорд╛ рез REM #iNumber рдЦреЛрдЬреНрдиреБрд╣реЛрд╕реН
рдкрд╛рда рд╕рдБрдЧ #iNumber,, "This is the first line of text" REM рднрд░реНрдиреЗ рд▓рд╛рдЗрди рд░рд╛рдЦреНрдиреБрд╣реЛрд╕реН
#iNumber рд░рд╛рдЦреНрдиреБрд╣реЛрд╕реН,, "This is the second line of text"
#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
#iNumber,,"рдпреЛ рдирдпрд╛рдБ рдкрд╛рда рд╣реЛ"рд░рд╛рдЦреНрдиреБрд╣реЛрд╕реН
Get #iNumber,1,sText
Get #iNumber,2,sText
#iNumber рд░рд╛рдЦреНрдиреБрд╣реЛрд╕реН,реиреж,"This is the text in record 20"
Print Lof(#iNumber)
Close #iNumber
End Sub